vue常见问题解决办法(二)|warning:component lists rendered with v-for should have explicit keys

命令行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.
截图如下:
vue常见问题解决办法(二)|warning:component lists rendered with v-for should have explicit keys_第1张图片
这里只是推荐使用key.
原本的代码如下:

          {{feiLei.name}}
          

运行时显示warning,添加:key即可,如下:

          {{feiLei.name}}
          

这样就不会报错啦,具体看文档,key不是必须的,仅仅是warning

你可能感兴趣的:(Vue.js)