VUETIFY/VUEJS- MD/LG/XL的多个条件
我在这里挣扎在基本上在Vue/vuetify中的断点上应用条件
,我想说的...如果阵列的长度可除以2,则MD = 6,如果它可以由3分,则MD = 12
<v-col cols="12"
:md="module.plannings.length % 2 === 0 ? 6 ? module.plannings.length % 2 === 0 ? 12 : 12"
v-for="planning in module.plannings"
:key="planning.id"
>
清楚地清楚我在这里以错误的方式进行操作..正确的语法是什么?
I'm struggling here applying conditions on the breakpoints in Vue/Vuetify
Basically, I want to say... if the length of the array is divisible by 2, then MD=6, if it is divisible by 3 then MD=12
<v-col cols="12"
:md="module.plannings.length % 2 === 0 ? 6 ? module.plannings.length % 2 === 0 ? 12 : 12"
v-for="planning in module.plannings"
:key="planning.id"
>
Clearly I'm going about it the wrong way here.. what would be the correct syntax?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以制作计算属性:
You can make computed property:
正确的语法将为
:md =“ plannings.length%2 === 0?6:12”
demo :
Correct syntax will be
:md="plannings.length % 2 === 0 ? 6 : 12"
Demo :