我有一个v-for循环VueJS,我想循环元素在两个组中的一个div内。VueJS - 有条件地包装在一个div
例如:
<div class="xpto" v-for="item in items"> //this div should wrap a maximum of two components per time
<component :item="item"></component>
</div>
什么会实现,最好的方法是什么?通过在所计算的从items
阵列引用的每个项目的索引和获取项目https://vuejs.org/v2/guide/list.html#Range-v-for