vetur插件提示[eslint-plugin-vue] [vue/require-v-for-key] Elements in iteration expect to.......错误

在vscode下编辑vue报错提示,遂记录下这个错误,以便日后再犯:

[vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.
Renders the element or template block multiple times based on the source data

使用VS Code 出现如下问题,如图

Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须的。

更改vetur配置            vscode->首选项->设置->搜索(vetur)

"vetur.validation.template": true,

改成:false

错误几乎一模一样,就不原创了

博主链接:https://blog.csdn.net/xufangfang99/article/details/77882792

猜你喜欢

转载自blog.csdn.net/qq_26975307/article/details/81952244