Ayman Tarig
Ayman Tarig

Reputation: 221

How to add image to v-card in vuetify

I want to achieve the design show in the image below:

enter image description here

My current design:

enter image description here

My code is:

<v-card v-for="book in books" :key="book.id" class="mb-2" tile="">
                <v-img :src="book.image" max-width="80"></v-img>
                <v-card-title>{{ book.title }} </v-card-title>
                <v-card-subtitle>{{ book.author }}</v-card-subtitle>
</v-card>

Upvotes: 0

Views: 5526

Answers (1)

Carol Skelly
Carol Skelly

Reputation: 362580

Use the grid row>cols ...

         <v-card class="mb-2" tile="">
                 <v-row align="start">
                    <v-col class="shrink">
                         <v-img src="//placehold.it/80x120" max-width="80" class="ml-3"></v-img>
                    </v-col>
                    <v-col>
                         <v-card-title class="pa-0">Title</v-card-title>
                         <v-card-subtitle>Author</v-card-subtitle>
                     </v-col>
                 </v-row>
         </v-card>

Demo: https://codeply.com/p/7aOBDcIOke

Upvotes: 3

Related Questions