[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives;清除错误提

在使用VSCode编辑器,开发vue项目的时候,v-for以及v-else在Eslint的规则检查下出现错误提示:Elements in iteration expect to have 'v-bind:key' directives;

Eslint规则检查显示如下:

 

[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives;清除错误提

 

错误提示如下: 

[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives;清除错误提

这是因为我们安装了ESLint插件,对vue进行了eslint检查,只需将这个规则检查屏蔽掉即可,具体操作如下:

首选项->设置,进入检索输入框,输入vetur.validation.template,加前面的选择框取消勾选即可。

[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives;清除错误提

 

------->>>>>>>>>

 

[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives;清除错误提

 

完成以后重启编辑器即可。

上一篇:前端调试技巧


下一篇:CopyOnWriteArrayList的底层源码学习