1、报错信息:

Failed to execute 'insertBefore’on 'Node': The node before which the new node is to be inserted is not a child
of this node.

2、可能原因:

代码标签使用索引(index)作为key值,index可能会随着页面重新渲染发生变化,使数据无法绑定。

【以前的数据和重新渲染后的数据随着 key 值的变化从而没法建立关联关系】

 3、建议改用:唯一id作为标识

v-for="(item,index) in list"  :key="item.id"

 

Logo

一站式 AI 云服务平台

更多推荐