今天遇到这个问题,遇到这个问题多数因为:key值的问题

第一种情况(key重复)

<div class="name-list" v-for="(item,index) in list" :key="item.sid">
{{item.name}}
</div>
list: [
{
sid:,
name:"张三",
},
{
sid:,
name:"李四",
},
]

第二种情况(页面上有两个for循环同一个数组,导致key重复)

<div class="name-list" v-for="(item,index) in list" :key="index">
{{item.name}}
</div> <div class="name-list" v-for="(item,index) in list" :key="index">
{{item.name}}
</div>

第二种解决

<div class="name-list" v-for="(item,index) in list" :key="index + ''_index">
{{item.name}}
</div> <div class="name-list" v-for="(item,index) in list" :key="'index_' + index">
{{item.name}}
</div>

1.解决这些问题找到其根源就好了。祝大家撸码之路顺畅无阻、

[Vue warn]: Duplicate keys detected: '1'. This may cause an update error的更多相关文章

  1. [Vue warn]: Duplicate keys detected: '0'. This may cause an update error.

    1.[Vue warn]: Duplicate keys detected: '0'. This may cause an update error. 第一眼看到这个错误一脸懵逼,项目使用很久了,代码 ...

  2. [Vue warn]: Duplicate keys detected: 'area'. This may cause an update error.

    运行vue程序,浏览器报错: 原因:检测到重复的密钥:'area',因为在使用v-for循环绑定的时候,key的值是唯一的,不能相同,否则会出现意想不到的bug 解决办法:v-for时绑定的key唯一

  3. vue报错之Duplicate keys detected: '0'. This may cause an update error.

    昨天运行vue项目的时候,出现了[Vue warn]: Duplicate keys detected: '0'. This may cause an update error(错误,检测到重复的ke ...

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

    在运行vue项目的时候报了:[Vue warn]: Duplicate keys detected: ‘0’. This may cause an update error(错误,检测到重复的key值 ...

  5. Vue报错 Duplicate keys detected: '1'. This may cause an update error. vue报错

    情况一.错误信息展示为关键字‘keys‘,此时应该检查for循环中的key,循环的key值不为唯一性 (很普通) 情况二.有两个相同的for循环,而这两个for循环的key值是一样的,此时将一个的ke ...

  6. [VUE ERROR] Duplicate keys detected: 'tab-user'. This may cause an update error.

    错误消息如图: 如果你看到此错误消息,则说明 v-for 指令的 key值 重复了,只需修改你的 key值 让其不会重复即可.

  7. ElementUI使用v-if控制tab标签显示遇到的Duplicate keys detected: 'xxx'问题

    今天工作遇到一个问题: 需求背景:页面中有几个tab,需要根据登录用户的权限控制tab标签的显示与隐藏 . <el-tabs @tab-click="handleClick" ...

  8. vue踩坑记录:[Vue warn]: $attrs is readonly.

    今天在用element-ui的DatePicker日期选择器的时候,发现每当点击一次这个组件,控制台就会报警告`[Vue warn]: $attrs is readonly`,但是也不影响实际操作效果 ...

  9. vue.runtime.esm.js:593 [Vue warn]: Invalid prop: custom validator check failed for prop "value".报错解决

    在uni中使用 picker组件,一直报错 vue.runtime.esm.js:593 [Vue warn]: Invalid prop: custom validator check failed ...

随机推荐

  1. deep learning RNN

    specialize  vi. 专攻;特化;专门从事;详细说明 vt.使专门化;使适应特殊情况;详细说明;列举 generalize  across vt.& vi.概括,归纳;推广,普及;使 ...

  2. 【集合】Java中的具体集合(一)

    Java中不止提供了集合框架中的接口,还提供了许多具体的实现. Java中的具体集合 集合类型 描述 ArrayList 一种可以动态增长和缩减的索引序列 LinkedList 一种可以在任何位置进行 ...

  3. position(3rd week blog)

    static:静态的默认属性,上(top)下(bottom)左(left)右(right)等参数不会执行没有影响.relative:此属性会根据上(top)下(bottom)左(left)右(righ ...

  4. [Tom and Bag][需要记录过程的dp]

    http://acm.beihua.edu.cn/problem/1007 Tom and Bag   Description Tom is the most handsome CCPC contes ...

  5. 2018-2019-2 20165313 Exp2 后门原理与实践

    实践基础问题回答 (1)例举你能想到的一个后门进入到你系统中的可能方式? 应用程序设定后门,用户安装后,后门就可以进入.例如课堂上讲到的百度. (2)例举你知道的后门如何启动起来(win及linux) ...

  6. JDK安装与环境配置——学习JAVA的准备工作

    1.安装JDK 官网,版本看了也不明白区别,我下载的第一个 JAVA SE 12 https://www.oracle.com/technetwork/java/javase/downloads/in ...

  7. 文件IO 相关的包:java.io文件——API

    文件IO 相关的包:java.io文件——API 1.Java.io.File类的使用(1)两种路径绝对路径:相对于当前路径:当前为 “工程名”(2)File类创建,对象为一个文件/目录,可能存在或不 ...

  8. django中云存储静态文件

    Django自带文件存储系统存储在本地文件夹,如果我们将文件存储在云端,需要自定义文件存储系统. 自定义文件存储系统需要继承django.core.files.storage.Storage from ...

  9. Flagr 架构

    来自官方文档 https://checkr.github.io/flagr/#/flagr_overview There are three components in the flagr, Flag ...

  10. HI3518EV200+AR0130开发板烧录uboot、kernel、rootfs及其参数配置

    分区名 分区大小 起始地址 截至地址bootloader:1M 0x00000000 0x00100000kernel: 3M 0x00100000 0x00400000rootfs: 12M 0x0 ...