您现在的位置是: 首页 > 前端开发 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 【前端开发】 5329人已围观 8497次浏览
简介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 项目完整部署方案
站长推荐
猜你喜欢
- CentOS 安装JDK
- Android SDK版本号与API级别的对照表
- 查看MySQL默认读取的配置文件
- 迁移 Docker 目录
- Debian apt 使用国内镜像
- SpringBoot 启动提示 Requested bean is currently in creation: Is there an unresolvable circular reference?
- 在使用Flutter进行网络请求时,使用Dio访问https地址出现unable to get local issuer certificate错误
- CentOS 安装Node.js
- SpringBoot 启动测试时出现提示 Test class should have exactly one public zero-argument constructor
- 获取阿里云CDN真实IP