vue常见问题解决办法(二)|warning:component lists rendered with v-for should have explicit keys
2017-06-26 16:13
781 查看
命令行warning(Emitted value instead of an instance of Error)。component lists rendered with v-for should have explicit keys。See https://vuejs.org/guide/list.html#key for more info.
截图如下:
这里只是推荐使用key.
原本的代码如下:
运行时显示warning,添加:key即可,如下:
这样就不会报错啦,具体看文档,key不是必须的,仅仅是warning
截图如下:
这里只是推荐使用key.
原本的代码如下:
<el-tag v-for = "feiLei of ruleForm.fenLeis" :closable = "true" type = "primary" @close = "handleCloseFenLei(feiLei)">{{feiLei.name}} </el-tag>
运行时显示warning,添加:key即可,如下:
<el-tag v-for = "feiLei of ruleForm.fenLeis" :key="feiLei1" :closable = "true" type = "primary" @close = "handleCloseFenLei(feiLei)">{{feiLei.name}} </el-tag>
这样就不会报错啦,具体看文档,key不是必须的,仅仅是warning
相关文章推荐
- 在Vue2.0 使用v-for时报这样的错误:component lists rendered with v-for should have explicit keys.解决方法:
- vue警告component lists rendered with v-for should have explicit keys
- component lists rendered with v-for should have explicit keys
- 记录一次使用v-for使用报错,提示component lists rendered with v-for should have explicit keys
- component lists rendered with v-for should have explicit keys
- component lists rendered with v-for should have 处理
- vue常见问题解决办法(一)|vue.js报错“Do not use 'new' for side effects“(main.js里)解决办法
- 常见问题及解决办法 整理之4(FOR XML PATH 语句的应用)
- 关于问题ld:library not found for -lXXX 和ld:warning:directory not found option 以及duplicate symbol的解决办法
- IIS Excel操作问题解决 Retrieving the COM class factory for component with CLSID {00024500-0000-000
- Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier解决办法
- 关于Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005的解决办法
- Android Studio Error:Execution failed for task ':***:compileDebugJavaWithJavac'问题解决办法
- No mapping found for HTTP request with URI 找不到图片或者其他的静态资源问题解决办法
- Hibernate常见问题 No row with the given identifier exists问题的解决办法及解决
- 关于问题ld:library not found for -lXXX 和ld:warning:directory not found option 以及duplicate symbol的解决办法
- 关于问题ld:library not found for -lXXX 和ld:warning:directory not found option 以及duplicate symbol的解决办法
- SQL Server Express常见问题及解决办法
- DIV+CSS构建网站时常会出现浏览器不兼容的问题,下面整理了一些常见不兼容问题,及解决办法!
- LumaQQ常见问题与解决办法