[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.
第一眼看到这个错误一脸懵逼,项目使用很久了,代码也没有改过,为什么控制台会报这个错,让我很费解,查了一下是因为两个v-for并行使用导致key的,测试了一下确实如此。说明如下:
a.控制台报错:

b.报错前代码

c.修改后,在其中一个并行的v-for里面修改key ,区别于下面的key即可

补充说明:如果有路过的大神知道具体原理,请留言说明,谢谢!
[Vue warn]: Duplicate keys detected: '0'. This may cause an update error.的更多相关文章
- [Vue warn]: Duplicate keys detected: 'area'. This may cause an update error.
运行vue程序,浏览器报错: 原因:检测到重复的密钥:'area',因为在使用v-for循环绑定的时候,key的值是唯一的,不能相同,否则会出现意想不到的bug 解决办法:v-for时绑定的key唯一
- [Vue warn]: Duplicate keys detected: '1'. This may cause an update error
今天遇到这个问题,遇到这个问题多数因为:key值的问题 第一种情况(key重复) <div class="name-list" v-for="(item,index ...
- 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 ...
- Duplicate keys detected: '0'. This may cause an update error.
在运行vue项目的时候报了:[Vue warn]: Duplicate keys detected: ‘0’. This may cause an update error(错误,检测到重复的key值 ...
- Vue报错 Duplicate keys detected: '1'. This may cause an update error. vue报错
情况一.错误信息展示为关键字‘keys‘,此时应该检查for循环中的key,循环的key值不为唯一性 (很普通) 情况二.有两个相同的for循环,而这两个for循环的key值是一样的,此时将一个的ke ...
- [VUE ERROR] Duplicate keys detected: 'tab-user'. This may cause an update error.
错误消息如图: 如果你看到此错误消息,则说明 v-for 指令的 key值 重复了,只需修改你的 key值 让其不会重复即可.
- ElementUI使用v-if控制tab标签显示遇到的Duplicate keys detected: 'xxx'问题
今天工作遇到一个问题: 需求背景:页面中有几个tab,需要根据登录用户的权限控制tab标签的显示与隐藏 . <el-tabs @tab-click="handleClick" ...
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ...
- vue.esm.js?efeb:628 [Vue warn]: Invalid prop: type check failed for prop "defaultActive". Expected String with value "0", got Number with value 0.
vue.esm.js?efeb:628 [Vue warn]: Invalid prop: type check failed for prop "defaultActive". ...
随机推荐
- SpringCloud学习成长之 十 高可用服务注册中心
文章 第一篇: 服务的注册与发现(Eureka) 介绍了服务注册与发现,其中服务注册中心Eureka Server,是一个实例,当成千上万个服务向它注册的时候,它的负载是非常高的,这在生产环境上是不太 ...
- SpringBoot集成tk mybatis插入数据,回显主键为null
实体信息如下 @Data public class ApiCertificate{ @Id @GeneratedValue(generator = "JDBC") private ...
- MySQL5.7查看数据存储位置
在MySQL客户端执行如下命令查看MySQL的数据存放位置: mysql> show global variables like "%datadir%"; +-------- ...
- node.js使用superagent实现模拟登陆功能(包含下载验证码功能)
superagent版本:3.8.3 样例代码: var process = require('process'); var superagent = require('superagent'); v ...
- 【Leetcode_easy】671. Second Minimum Node In a Binary Tree
problem 671. Second Minimum Node In a Binary Tree 参考 1. Leetcode_easy_671. Second Minimum Node In a ...
- nmap探测大网络空间中的存活主机
前言 扫描大网络空间中的存活主机 实现 nmap -v -sn -PE -n --min-hostgroup 1024 --min-parallelism 1024 -oX nmap_output.x ...
- iOS-UIView的layoutSubviews和drawRect方法何时调用(转)
转自:http://jianyu996.blog.163.com/blog/static/112114555201305113018814/ 首先两个方法都是异步执行.layoutSubviews方便 ...
- Max coverage disjoint intervals
Assume you have k<=10^5 intervals [a_i, b_i] \in [1,10^18] (some of them may overlap), and you ne ...
- ASP.NET请求过程-基本过程
客户端发送请求到达服务器 输入域名->DNS解析->指定IP 服务器(如果网页直接输入IP地址则直接到服务器)->请求到达服务器->HTTP.SYS接受HTTP请求->转 ...
- 正则表达式(Regular Expression, RegEx)学习入门
1. 概述 正则表达式(Regular Expression, RegEx)是一种匹配模式,描述的是一串文本的特征. 正如自然语言中高大.坚固等词语抽象出来描述事物特征一样,正则表达式就是字符的高度抽 ...