Duplicate keys detected: '0'原因及解决方法

简介: Duplicate keys detected: '0'原因及解决方法

Duplicate keys detected: '0'. This may cause an update error.


错误原因


一个template中有两个一样的v-for


<div class="info" v-for="(item, index) in currentFriend.content" :key="index">
    <div class="d1">
            <p v-text="item.time" class="timeBox"></p>
    </div>
</div>
<div class="info2" v-for="(item, index) in currentFriend.content" :key="'index">
    <div class="d2">
          <p v-text="item.time" class="timeBox"></p>
      </div>
</div>


解决办法,


将其中以个的key修改一下,参考http://www.wityx.com/web/


<div class="info2" v-for="(item, index) in currentFriend.content" :key="'info2-'+index">
    <div class="d2">
          <p v-text="item.time" class="timeBox"></p>
      </div>
</div>


相关文章
|
IDE PyTorch 网络安全
|
关系型数据库 Shell Oracle
RMAN-01009: syntax error: found "dot" 解决办法
RMAN-01009: syntax error: found "dot" 解决方法   今天调试一个RMAN 的备份脚本,这个脚本以前也用过很多次,并没有什么问题,今天执行时,就是过不去。
1446 0
|
3月前
|
安全 关系型数据库 MySQL
openvas报错Warning: Secinfo Database Missing SCAP and/or CERT database missing on OMP server.
openvas报错Warning: Secinfo Database Missing SCAP and/or CERT database missing on OMP server.
|
6月前
|
JavaScript
vue报错 | Duplicate keys detected: ‘0’. This may cause an update error.
vue报错 | Duplicate keys detected: ‘0’. This may cause an update error.
66 3
|
6月前
|
JavaScript
Error loading saved preferences: ~/.vuerc may be corrupted or have syntax errors. Please fix/delete
Error loading saved preferences: ~/.vuerc may be corrupted or have syntax errors. Please fix/delete
|
JavaScript
[Vue warn]: Duplicate keys detected: ‘1‘. This may cause an update error. for循环,key重复报错
[Vue warn]: Duplicate keys detected: ‘1‘. This may cause an update error. for循环,key重复报错
74 0
|
JavaScript
[Vue warn]: Duplicate keys detected: ‘0‘. This may cause an update error.
首先Duplicate keys detected: '0'. This may cause an update error是vue发现key不是唯一的而引发的错误. 译为中文大概是 : 检测到重复键 : '0'. '0'可能会导致一个更新错误. 解决办法网上找的其他也有一些.通过手动进行修改:key进而解决,比如说进行拼接字符串.因为为了解决不报错,而手动修改了数据.个人感觉不应该是这样的.
286 0
[Vue warn]: Duplicate keys detected: ‘0‘. This may cause an update error.
|
存储 关系型数据库 MySQL
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
4094 0
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
subclipse同步冲突问题A conflict in the working copy obstructs the current operation
subclipse同步冲突问题A conflict in the working copy obstructs the current operation
109 0
subclipse同步冲突问题A conflict in the working copy obstructs the current operation

热门文章

最新文章