Elements in iteration expect to have 'v-bind:key' directives

https://github.com/vuejs/vetur/issues/858

vuejs v-for add bootstrap row every 5 items

<script src="https://vuejs.org/js/vue.min.js"></script>
<div id="demo">
  <div class="row" v-for="i in Math.ceil(items.length / 5)">
    <span v-for="item in items.slice((i - 1) * 5, i * 5)">
  {{item}}
</span>
  </div>
</div>

这段代码会有提示错误,

但是在jsfiddle里面,可以正常运行 https://jsfiddle.net/ud25tGNwMddCP7JI/jc1u78r0/1/

 

上一篇:【LeetCode】347. Top K Frequent Elements 前 K 个高频元素(Medium)(JAVA)


下一篇:Python for Data Science - Defining elements of a plot