vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法


错误提示:

[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



你可能感兴趣的:(web)