一、错误如下
[eslint-plugin-vue]
[vue/require-v-for-key]
Elements in iteration expect to have 'v-bind:key' directives.

Renders the element or template block multiple times based on the source data.

使用VS Code 出现如下问题,如图

二、解决

  在用vscode编写vue代码时,因为安装的有vetur插件,所以当代码中有v-for语法时,会提示,“Elements in iteration expect to have 'v-bind:key' directives.”这个错误

这是ESLint的功能,对vue进行了eslint检查。那么我们就把eslint对该插件的检查关闭,

更改vetur配置            vscode->首选项->设置->搜索(vetur)

 把  "vetur.validation.template": true  改成  false

 保存,我们再看一下vue文件,发现不报错了。

Elements in iteration expect to have 'v-bind:key' directives错误的解决办法的更多相关文章

  1. vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法

    错误提示: [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.Renders the ...

  2. vscode的vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法

    1.使用VS Code 出现如下问题,如图 Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须的. 2.更改vetur配置 vscode->文件->首选项->用户 ...

  3. vue开发中v-for在Eslint的规则检查下出现:Elements in iteration expect to have 'v-bind:key' directives

    在使用VScode编辑器vue开发过程中,v-for在Eslint的规则检查下出现报错:Elements in iteration expect to have 'v-bind:key' direct ...

  4. v-for 在 VSCode 中出现 Elements in iteration expect to have 'v-bind:key' directives.

    在 VSCode 中编辑代码时,在有 v-for 的语句下面有一条红色波浪线,鼠标放上去有提示 Elements in iteration expect to have 'v-bind:key' di ...

  5. vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives

    vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives Vue 2.2.0+的版本里,当在组件 ...

  6. vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives

    错误如下图所示: 错误提示: [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.Re ...

  7. 遇到Elements in iteration expect to have 'v-bind:key' directives.' 这个错误

    解决方式一:更改VS Code编辑器的vetur配置 错误提示: [vue-language-server] Elements in iteration expect to have 'v-bind: ...

  8. Elements in iteration expect to have 'v-bind:key' directives.' 提示错误如何解决?

    在学习vue过程中遇到Elements in iteration expect to have 'v-bind:key' directives.' 这个错误,查阅资料得知Vue 2.2.0+的版本里, ...

  9. vue的开发中v-for报错 [vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives.

    用的VS Code 工具,安装了vetur插件,报错了如下 [eslint-plugin-vue] [vue/require-v-for-key] Elements in iteration expe ...

随机推荐

  1. [原创]Java使用反射及自定义注解实现对象差异性比较

    Java项目C中 有一处逻辑,对于资源数据(类型为ResourceItem,拥有int/double/boolean/String类型数十个字段),需要比对资源数据每次变更的差异,并描述出变更情况.并 ...

  2. Mycat实战之数据迁移(oracle -- mysql)

    1.案例场景: Mycat 后面接一个 Oracle 实例与一个 MySQL 实例,假设用户表,订单表,转账记录表, Oracle 字符集为 GBK 的,MySQL 字符集则要求 UTF8的 完成用户 ...

  3. 【知识碎片】CSS 篇

    1.CSS达到截取效果 地方卡机了会计师的立法及  =>  地方卡机了... max-width: 400px; overflow: hidden; white-space: nowrap; t ...

  4. IE bug之location.href没有referer

    使用js实现跳转一般会用 location.href="www.google.com"; 这样在一般的浏览器中可以在服务器端正常的获取referer,但是如果是IE浏览器就不正常了 ...

  5. 【原】Zookeeper 概述 + 官网 Overview 翻译

    分布式应用 分布式应用 distributed application可以在给定时间(同时)在网络中的多个系统上运行,通过协调它们以快速有效的方式完成特定任务. (a), (b): a distrib ...

  6. 详解PHP执行定时任务的实现思路

    PHP本身是没有定时功能的,PHP也不能多线程.PHP的定时任务功能必须通过和其他工具结合才能实现,例如WordPress内置了wp-cron的功能,很厉害. 一.Linux服务器上使用CronTab ...

  7. Windchill 设计变更流程卡死查询方法

    设计变更流程卡死查询方法 1. 导出设计变更表单查看填写了“需要”和“是”字眼的文本框  2.打开进程管理器显示流程卡死的地方,确定哪里出错导致没法执行下一步  3.打开设计变更流程图,里面可以查看有 ...

  8. java基础之io流总结三:字节流读写

    字节流读写适用于任何文件,包括图片,视频等. 基本字节流 一次读一个字节和一次读一个字节数组 FileInputStream fis = new FileInputStream(path); //一次 ...

  9. Codeforces 1153D 树形DP

    题意:有一个游戏,规则如下:每个点有一个标号,为max或min, max是指这个点的值是所有子节点中值最大的那一个,min同理.问如何给这颗树的叶子节点赋值,可以让这棵树的根节点值最大. 思路:很明显 ...

  10. WEBAPI使用过滤器对API接口进行验证

    用户登录控制器:[ActionFilter]自定义过滤器 用户信息:var userData = new JObject();                   userData.Add(" ...