v-for报错:[vue/require-v-for-key] Elements in iteration expect to have ‘v-bind:key‘ directives

报错v-for报错:[vue/require-v-for-key] Elements in iteration expect to have ‘v-bind:key‘ directives_第1张图片

翻译

Elements in iteration expect to have ‘v-bind:key’ directives
迭代中的元素希望有“v-bind:key”指令

解决办法

一种方法是“屏蔽ESLint对vue语法的检查”(不建议这样做,都查出来语法有问题了)
另一种就是“在v-for后面加上:key=“index””(加key不建议用index)

参考:

https://blog.csdn.net/Doctor_LY/article/details/95488260.’

https://blog.csdn.net/weixin_46174785/article/details/107265365?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162642555516780366599729%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=162642555516780366599729&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_v2~rank_v29-2-107265365.pc_search_result_cache&utm_term=v-for%E4%B8%AD%E7%94%A8index&spm=1018.2226.3001.4187.

你可能感兴趣的:(vue,vue)