美文网首页Vue大前端
vscode提示Elements in iteration ex

vscode提示Elements in iteration ex

作者: 左木北鱼 | 来源:发表于2018-11-25 14:56 被阅读2次

一、错误提示:

[eslint-plugin-vue]

[vue/require-v-for-key]

Elements in iteration expect to have 'v-bind:key' directives.

如图:

二、问题原因:Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须的。

三、解决方法:

1> 更改vetur配置

位置:vscode->首选项->设置->搜索(vetur)

2> 添加key

相关文章

网友评论

    本文标题:vscode提示Elements in iteration ex

    本文链接:https://www.haomeiwen.com/subject/nfppqqtx.html