其他分享
首页 > 其他分享> > Elements in iteration expect to have 'v-bind:key' directives

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/

 

标签:jc1u78r0,Elements,vuejs,bind,iteration,expect,https,jsfiddle,issues
来源: https://www.cnblogs.com/chucklu/p/14207283.html