We're going to add a short description to the component now for a little bit more content.
If you'd like to try this on your own, please do. Otherwise you can follow the steps below.
In src/pages/index.vue
, create a new line under your pageCount
function.
Don't forget to use the const
keyword and give it a name, in our case shortDescription
.
You can follow the pageCount
pattern to help. Make the variable return the value of book.shortDescription
.
Following the pattern of the :pageCount
prop, add a prop for :shortDescription
that equals your shortDescription
function.
Note: the webpage will not yet show your description property because we need to add it to the BookCard.vue
file.
- Open
src/components/BookCard.vue
. - Remove the forward slashes and space (
//
) from the line// description: String,
. - Copy the line
:text="shortDescription"
from<v-card-copy />
. - Paste it under the
:subtitle="pageCount"
line in<v-card />
.
The webpage should now look like this: