【发布时间】:2018-06-16 15:50:50
【问题描述】:
问题:
我有一个循环显示指定数量的卡片。
问题在于<v-flex> 中的ma-5 属性。在xs 屏幕尺寸上,此边距太大。如何为不同的屏幕尺寸指定不同的边距?
代码:
<v-container>
<v-layout row wrap>
<v-flex xs12 sm6 md4 ma-5 v-for="card in filteredCards" :key="card.id">
<v-card flat class="elevation-20 test">
<v-card-media :src="card.image" height="200px">
</v-card-media>
<v-card-title primary-title class="pa-4">
<div>
<h3 class="headline mb-0">{{card.title}}</h3>
<div style="min-height:50px;">{{card.description}}</div>
</div>
</v-card-title>
</v-card>
</v-flex>
</v-layout>
</v-container>
试过了:
我尝试在下面添加此代码(复制自 this 页面)
<v-flex xs12 sm6 md4 v-for="card in filteredCards" :key="card.id"
:class="{'ma-0': $breakpoint.smAndDown, 'ma-5': $breakpoint.mdAndUp}">
我收到以下错误:
[Vue warn]: Property or method "$breakpoint" is not defined on the instance but referenced during render[Vue warn]: Error in render: "TypeError: Cannot read property 'smAndDown' of undefined"TypeError: Cannot read property 'smAndDown' of undefined
【问题讨论】:
标签: vuetify.js