如何在vuetify中将图像添加到v卡

时间:2020-03-23 18:27:56

标签: vue.js vuetify.js

我要实现下图所示的设计:

enter image description here

我当前的设计:

enter image description here

我的代码是:

<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>

1 个答案:

答案 0 :(得分:1)

使用网格行> 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>

演示:https://codeply.com/p/7aOBDcIOke