vue报错解决Duplicate keys detected: ‘[object Object]’
最近在做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]’的更多相关文章
- 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 ...
- Python使用suds调用webservice报错解决方法:AttributeError: 'Document' object has no attribute 'set'
使用python的suds包调用webservice服务接口,报错:AttributeError: 'Document' object has no attribute 'set' 调用服务接口代码: ...
- vue 报错解决:TypeError: Cannot read property '_t' of undefined"
前端报错如下: [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined" 是 ...
- 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 解 ...
- [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. 第一眼看到这个错误一脸懵逼,项目使用很久了,代码 ...
- django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法
django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法 django.db ...
- vue3 报错解决:找不到模块‘xxx.vue’或其相应的类型声明。(Vue 3 can not find module)
最近在用 vue3 写一个小组件库,在 ts 文件中引入 .vue 文件时出现以下报错: 报错原因:typescript 只能理解 .ts 文件,无法理解 .vue文件 解决方法:在项目根目录或 sr ...
- 解决element-ui表格多重嵌套循环时,添加row-key="id" 出现Duplicate keys detected: 'XXX' 错误的问题
Duplicate keys detected: 'XXX' 错误,怀疑是多重嵌套循环时 :key="item.id或index" 不能重复的问题,但设置了不同的 key 后并未解 ...
- vue 项目 npm install 报错解决
node-sass 安装报错解决办法 2017年04月15日 14:34:25 阅读数:20189 E:\kibana>npm install node-sass > node-sass@ ...
- vue报错信息
1.Property or method "xxx" is not defined on the instance but referenced during render. 原因 ...
随机推荐
- Redis源码之SDS简单动态字符串
Redis 是内存数据库,高效使用内存对 Redis 的实现来说非常重要. 看一下,Redis 中针对字符串结构针对内存使用效率做的设计优化. 一.SDS的结构 c语言没有string类型,本质是ch ...
- yolov5训练自己的数据集
1.安装cuda 可以先看看自己的 显卡信息,支持哪个cuda版本 cuda下载地址:https://developer.nvidia.com/cuda-toolkit-archive 我的RTX30 ...
- 两种路由模式的区别(hash模式,history模式)
1. hash 带#号的,history不带#号2.hash模式用的hashChange监听路径的变化3.history用的是HTML5相关的API语法 使用pushState => 添加一条历 ...
- 火山引擎 DataTester:让企业“无代码”也能用起来的 A/B 实验平台
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 当数字化变革方兴未艾,无代码正受到前所未有的关注.Salesforce 的数据显示,52%的 IT 部门表示,公司 ...
- selenium部分知识点总结
selenium部分总结 最近写了一个selenium自动化脚本. 基于此总结一些常用的代码 1. 用户输入换行符不终止输入 strings = '' s = input('请输入:(q停止输入)') ...
- CTFshow愚人杯-被遗忘的反序列化
这题虽然只有100的分值,但是我觉得它涉及到的东西还蛮多的,写个随笔记录一下. 题目 <?php # 当前目录中有一个txt文件哦 error_reporting(0); show_source ...
- 可视化大屏的终极解决方案居然这么简单,vue-autofit一行全搞定!
可视化大屏适配/自适应现状 可视化大屏的适配是一个老生常谈的话题了,现在其实不乏一些大佬开源的自适应插件.工具但是我为什么还要重复造轮子呢?因为目前市面上适配工具每一个都无法做到完美的效果,做出来的东 ...
- Azure DevOps(二)Azure Pipeline 集成 SonarQube 维护代码质量和安全性
一,引言 对于今天所分析的 SonarQube,首先我们得了解什么是 SonarQube ? SonarQube 又能帮我们做什么?我们是否在项目开发的过程中遇到人为 Review 代码审核规范?带着 ...
- 机器学习02-(损失函数loss、梯度下降、线性回归、评估训练、模型加载、岭回归、多项式回归)
机器学习-02 回归模型 线性回归 评估训练结果误差(metrics) 模型的保存和加载 岭回归 多项式回归 代码总结 线性回归 绘制图像,观察w0.w1.loss的变化过程 以等高线的方式绘制梯度下 ...
- 基于ORB-SLAM3库搭建SLAM系统
参考资料 ORB-SLAM3配置及安装教程 ORB-SLAM3配置安装及运行 环境配置 Win 11pro VMware 17Pro Ubuntu 18.04 Eigen3 Pangolin Open ...