您现在的位置是: 首页 > 前端开发 Vue 报错 Avoid using non-primitive value as key, use string/number value instead
Vue 报错 Avoid using non-primitive value as key, use string/number value instead
2020-09-09 【前端开发】 4425人已围观 7098次浏览
简介Vue 报错 Avoid using non-primitive value as key, use string/number value instead
Vue 项目开发中,控制台出现提示
Avoid using non-primitive value as key, use string/number value instead
避免使用非基元值作为键,而是使用字符串/数字值
一般出现此类提示都是因为在 v-for 循环中,绑定的 key 是对象的原因,比如
<div
v-for="item in bannerList"
:key="item">
</div>
在这种情况下,item 实际就是个对象,而不是具体的字符串或者数值,所以才会出现上面提示的报错
修改为下面的形式,将绑定的key设置为具体的内容字段即可,比如
<div
v-for="item in bannerList"
:key="item.id">
</div>
修改之后,保存刷新页面,报错提示就没有了
很赞哦! (0)
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- 防止Time Machine备份Parallels Desktop的虚拟硬盘文件
- npm 出现 Unexpected token < in JSON at position 21330
- Linux 安装 Tengine
- Python自动生成和安装requirements.txt文件中的依赖
- SqlServer 查询包含指定字段的存储过程
- cmder vim方向键无法使用 解决方案
- Mac禁用Adobe Creative Cloud自启状态栏
- 优化 Mac 上 office 软件更新慢的问题
- gulp3 在 node12 上运行出现异常 primordials is not defined
- SpringBoot 启动测试时出现提示 Test class should have exactly one public zero-argument constructor