页面刷新几次,就会报错(刷新方式:重新发送ajax请求改变data中的数据),但是有时候多刷新几次就报错有时候刷新很多次才报错:
[Vue warn]: It seems there are duplicate keys that is causing an update error. Make sure each v-for item has a unique key.
vue.esm.js?1a4e:434 [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'key' of undefined"
我的问题是,每次刷新数据的时候,key也会跟着变(代码如下),我使用的key是用每个item的inedx,所以每次应该不会有冲突啊,,为什么多每次点击页面重新加载新数据就会出现错误?
v-for="(item2,index2) in bookrecomment_info" :book="item2" :key="index2"
你把key换成其他关键字试试~比如keyWords