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修改一下
<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>