elementUi踩坑:Custom elements in iteration require ‘v-bind:key’ directives.
1.错误信息:
在使用vue脚手架开发时使用element组件所遇到的一个一个问题:Custom elements in iteration require ‘v-bind:key’ directives.如图:
- 解决办法:
原因:vue更新到2.2+版本后v-for指令需要绑定对应的key。设置key后编译器通过。如图:
- 注意事项:
还是得多注意vue的帮助文档。多看多记!
https://eslint.vuejs.org/rules/valid-v-for.html
https://cn.vuejs.org/v2/guide/index.html