最近在做vue项目时遇到了报错

​ Duplicate keys detected: ‘[object Object]’. This may cause an update error.

​ 由于这个问题是第一次遇见,所以在解决起来废了点时间

解决:在遍历数组时 :key书写错误,

​ 我的错误写法

   		<ul>
<li v-for="v in caseintrocon" :key="i">
<p><em>{{v.data_m_d}}</em>{{v.data_y}}</p>
<p><strong>{{v.title}}</strong></p>
<p>{{v.text_con}}</p>
</li>
</ul>

改正后的写法:

​

		<ul>
<li v-for="(v,i) in caseintrocon" :key="i">
<p><em>{{v.data_m_d}}</em>{{v.data_y}}</p>
<p><strong>{{v.title}}</strong></p>
<p>{{v.text_con}}</p>
</li>
</ul>

总结:平时用修改前的方式写代码也没有出错,这次代码出错给了我个提醒,以后书写代码要更加规范
欢迎来访我的博客,一起学习更多:Plumliil

vue报错解决Duplicate keys detected: ‘[object Object]’的更多相关文章

  1. 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 ...

  2. Python使用suds调用webservice报错解决方法:AttributeError: 'Document' object has no attribute 'set'

    使用python的suds包调用webservice服务接口,报错:AttributeError: 'Document' object has no attribute 'set' 调用服务接口代码: ...

  3. vue 报错解决:TypeError: Cannot read property '_t' of undefined"

    前端报错如下: [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined" 是 ...

  4. Keil 报错解决方法:Cannot link object xxx.o as its attributes are incompatile with the image attributes

    链接其他人的lib库时报错:Cannot link object xxx.o as its attributes are incompatile with the image attributes 解 ...

  5. [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. 第一眼看到这个错误一脸懵逼,项目使用很久了,代码 ...

  6. django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法

    django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法 django.db ...

  7. vue3 报错解决:找不到模块‘xxx.vue’或其相应的类型声明。(Vue 3 can not find module)

    最近在用 vue3 写一个小组件库,在 ts 文件中引入 .vue 文件时出现以下报错: 报错原因:typescript 只能理解 .ts 文件,无法理解 .vue文件 解决方法:在项目根目录或 sr ...

  8. 解决element-ui表格多重嵌套循环时,添加row-key="id" 出现Duplicate keys detected: 'XXX' 错误的问题

    Duplicate keys detected: 'XXX' 错误,怀疑是多重嵌套循环时 :key="item.id或index" 不能重复的问题,但设置了不同的 key 后并未解 ...

  9. vue 项目 npm install 报错解决

    node-sass 安装报错解决办法 2017年04月15日 14:34:25 阅读数:20189 E:\kibana>npm install node-sass > node-sass@ ...

  10. vue报错信息

    1.Property or method "xxx" is not defined on the instance but referenced during render. 原因 ...

随机推荐

  1. Golang一日一库之 日志库 zap

    简介 在开发过程中 会使用到日志库去记录错误的日志,尤其是golang中 有无穷无尽的error 如果不记录,当你的代码出错,就无从排错了. zap 是开源的 Go 高性能日志库 主要有以下特点: 支 ...

  2. 【Java SE】网络编程

    1. 网络编程概述 网络编程的目的:直接或者间接地通过网络协议与其他计算机实现数据交换,进行通讯. 网络编程两个主要的问题: ①如何精准地定位网络上的一台或多台主机,并定位主机上的特定应用 ②找到主机 ...

  3. String知识点整理

    使用双引号创建字符串时,JVM会现在字符串常量池中查找是否已存在该字符串,存在则返回,不存在则在池中创建后再返回.与此同时,使用String的intern方法也是类似处理. 使用new String的 ...

  4. PYTHON数据分析——python基础

    利用命令行创建python文件 C:\Users\Your Name>python myfile.py Python 变量命名规则: 变量名必须以字母或下划线字符开头 变量名称不能以数字开头 变 ...

  5. SpringCloud Gateway 3.x 响应头添加 Skywalking TraceId

    在微服务架构中,一次请求可能会被多个服务处理,而每个服务又会产生相应的日志,且每个服务也会有多个实例.在这种情况下,如果系统发生异常,没有 Trace ID,那么在进行日志分析和追踪时就会非常困难,因 ...

  6. go中 for循环的坑

    go中 for循环的坑 在使用for循环修改结构体切片中的值时,发现并没有修改成功. type Dog struct { name string } func (d *Dog) setNewName( ...

  7. 当 SQL Server(mssql-jdbc) 遇上 BigDecimal → 精度丢失,真坑!

    开心一刻 中午和哥们一起喝茶 哥们说道:晚上喝酒去啊 我:不去,我女朋友过生日 哥们瞪大眼睛看着我:你有病吧,充气的过什么生日 我生气到:有特么生产日期的好吧 需求背景 系统对接了外部系统,调用外部系 ...

  8. 命令行编译和执行java代码

    虽然现在IDE很强大又很智能,但是平常随意写点练手的代码的时候,直接在命令行中使用vim和java命令更为方便快捷,可以做到无鼠标纯键盘的操作. 首先保证将java相关指令添加到了环境变量中: 1.编 ...

  9. 【Python基础】集合的基本使用

    Python中的集合是一种无序且唯一的数据结构.集合是通过花括号{}或者set()函数来创建的. 创建集合 s = set() 声明空集合 s = {1,2,3,4,5} 声明非空集合 添加元素 s. ...

  10. jenkins的安装和配置(flask结合jenkins半自动化部署流程)

    jenkins在虚拟机中安装 1.1 背景介绍 Jenkins 是一款流行的开源持续集成(Continuous Integration)工具,广泛用于项目开发,具有自动化构建.测试和部署等功能. Je ...