在使用VScode編輯器vue開發過程中,v-for在Eslint的規則檢查下出現報錯:Elements in iteration expect to have ‘v-bind:key’ directives
Eslint規則檢查顯示如下:
報錯信息如下:
[eslint-plugin-vue]
[vue/require-v-for-key]
Elements in iteration expect to have 'v-bind:key' directives.
這是因為我們安裝了ESLint插件,對vue進行了eslint檢查,只需將這個規則檢查屏蔽掉即可,具體操作如下:
文件–》首選項–》設置–》在搜索框中輸入:vetur.validation.template–》找到vetur.validation.template:true–》將vetur.validation.template:true在右欄框中進行重置為false就ok了。
如圖: