vetur插件提示 'v-for' directives require 'v-bind:key' directives.错误的解决办法
2017-06-26 16:15
609 查看
在用vscode编写vue代码时,因为安装的有vetur插件,所以当代码中有v-for语法时,会提示
[vue-language-server] 'v-for' directives require 'v-bind:key' directives.
我们知道vue在升级到2.2后,当在组件中使用
下面是vue官方文档的说明:
回头看一下,我们写的代码 v-for中有key,但是为什么还报错呢?
去vetur插件的github上搜了一下,发现有人提这个报错问题,该插件的作者给出了解决办法:
This is intended ESLint feature. You can turn off eslint check in future release.
Setting
这是ESLint的功能。对vue进行了eslint检查。
那么我们就把eslint对该插件的检查关闭,
在vscode中,打开 文件>首选项>设置 找到
vetur.configuration 把 "vetur.validation.template": true 改成
"vetur.validation.template": false
保存,我们再看一下vue文件,发现不报错了。
[vue-language-server] 'v-for' directives require 'v-bind:key' directives.
我们知道vue在升级到2.2后,当在组件中使用
v-for时,
key现在是必须的。
下面是vue官方文档的说明:
回头看一下,我们写的代码 v-for中有key,但是为什么还报错呢?
去vetur插件的github上搜了一下,发现有人提这个报错问题,该插件的作者给出了解决办法:
This is intended ESLint feature. You can turn off eslint check in future release.
Setting
vetur.validation.vue-htmlto false will disable it.
这是ESLint的功能。对vue进行了eslint检查。
那么我们就把eslint对该插件的检查关闭,
在vscode中,打开 文件>首选项>设置 找到
vetur.configuration 把 "vetur.validation.template": true 改成
"vetur.validation.template": false
保存,我们再看一下vue文件,发现不报错了。
相关文章推荐
- vue2.0 vetur插件提示 'v-for' directives require 'v-bind:key' directives 的解决办法
- vscode的vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法
- vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法
- vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法
- vetur插件提示 'v-for' directives require 'v-bind:key' directives.错误的解决办法
- 关于ThinkPHP下使用Uploadify插件 仅有火狐提示HTTP Error (302)错误的解决办法
- eclipse安装插件提示Duplicate Location错误的解决办法
- weiphp 3.0创建插件提示错误解决办法 提示您没有创建目录写入权限,
- sublimelinter phpfmt php代码语法错误提示 代码缩进整理 插件自动删除没有引用的代码片段,解决办法
- Discuz!教程之应用中心安装插件提示“数据下载错误(105)”的解决办法
- Silverlight插件安装失败,提示1603错误号的解决办法
- 解决Openwrt安装插件提示一下错误的办法
- 举例android项目中的string.xml出现这个The character reference must end with the ';' delimiter.错误提示的原因及解决办法
- word与有道插件冲突导致word打开提示有关宏错误解决办法!
- 关于ThinkPHP下使用Uploadify插件提示HTTP Error (302)错误的解决办法
- 安装iis打开网站提示Microsoft JET Database Engine 错误 '80004005'解决办法
- eclipse安装插件提示Duplicate Location错误的解决办法
- pidgin 使用飞信插件 提示密码错误的解决办法!
- 安装IIS时出现安装程序无法复制文件提示:0x4b8错误的解决办法
- 关于sql server2000提示:SSL安全错误 connectionopen(secdoclienthandshake()) 的解决办法