最近在做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. sql lag函数

    lag https://spark.apache.org/docs/latest/api/sql/#lag lag(input[, offset[, default]]) OVER (PARTITIO ...

  2. 做个清醒的程序员之拥抱AI

    阅读时长约 13 分钟,共计约 3100个字. 昨天我体验了AI自动生成短视频,具体说来,首先我在域名为FreeGPT的免费网站,向它提问,然后生成一段文字.之后呢,再用剪映里面的"图文成片 ...

  3. 1748E Yet Another Array Counting Problem

    1748E Yet Another Array Counting Problem 目录 1748E Yet Another Array Counting Problem 题目大意: 做法 code 题 ...

  4. API网关:开源Apinto网关-上游服务篇(二)

    功能介绍 服务发现是一种分布式系统中的关键技术,它能够帮助应用程序动态地发现和访问依赖的服务实例,解决了服务实例分布在不同节点上的问题.通过服务发现,应用程序可以快速找到需要调用的服务实例的位置和元数 ...

  5. XMake学习笔记(1):Windows(MSYS2)下MinGW-w64环境搭建和XMake安装

    以前写的C++基本都是C with STL,大多是面向过程的算法题,或者比较小的项目,然后经常报各种编译错误(对编译原理不熟),经常把人搞到崩溃,搞不懂构建.链接之类的东西. 现在开始记录一下XMak ...

  6. Grafana 系列-统一展示-3-Prometheus 仪表板

    系列文章 Grafana 系列文章 知识储备 Prometheus Template Variables 你可以使用变量来代替硬编码的细节,如 server.app 和 pod_name 在 metr ...

  7. springMVC中注解

    其中常见注解: 1.@RequestMapping:用于请求url路径,可用于类和方法上,用于类上,则表示类中所有响应请求的方法都是以该路径作为父路径. 2.@RequestBody:注解实现接收 h ...

  8. Docker私有仓库harbor

    Docker私有仓库harbor 目录 Docker私有仓库harbor Harbor私有仓库介绍 Harbor部署 harbor页面不显示排错思路 Harbor的使用 Harbor拉镜像 自制镜像推 ...

  9. 数据库定时备份winserver2012篇

    目录 1 序言 2 任务计划相关知识点介绍 2.1 任务计划 是什么? 2.2 批处理文件 2.2.1 批处理文件简介 2.2.2 批处理常用命令介绍 3 各个数据库备份脚本 3.1 Oracle数据 ...

  10. 2022-04-26:给定一个数组componets,长度为A, componets[i] = j,代表i类型的任务需要耗时j 给定一个二维数组orders,长度为M, orders[i][0]代表i

    2022-04-26:给定一个数组componets,长度为A, componets[i] = j,代表i类型的任务需要耗时j 给定一个二维数组orders,长度为M, orders[i][0]代表i ...