一、错误如下
[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. 迷你MVVM框架 avalonjs 0.99发布

    在本版本主要是性能优化,添加一些有用的功能(如回调什么的),离成品阶段不远了. 修正 updateViewModel bug 修正监控数组的set方法 bug 添加data-each-rendered ...

  2. 解决mybatis中转义字符的问题

    xml格式中不允许出现类似“>”这样的字符,有如下两种解决方法 方法一:使用转义字符 SELECT * FROM test WHERE 1 = 1 AND start_date <= CU ...

  3. css字体属性(font)

    字体名称属性(font-family) 这个属性设定字体名称,如Arial, Tahoma, Courier等.例句如下: .s1 {font-family:Arial}     字体大小属性(fon ...

  4. 阿帕奇配置本地虚拟站点,XAMPP环境下

    首先利用XAMPP搭建的阿帕奇环境,必须得启动,不能启动的话www.baidu.com 在XAMPP的目录下的apache,打开httpd-vhosts.conf文件 E:\XAMPP\apache\ ...

  5. 2014蓝桥杯B组初赛试题《奇怪的分式》

    题目描述: 上小学的时候,小明经常自己发明新算法.一次,老师出的题目是:     1/4 乘以 8/5      小明居然把分子拼接在一起,分母拼接在一起,答案是:18/45 (参见图1.png)   ...

  6. c++ 门面模式(Facade)

    门面模式是比较常用的一种设计模式,我们可能在无意中就会使用,门面模式就是用一个门面类来处理子系统的复杂关系,门面类简单的Api接口供客户端调用.用一个简单的演播室来表示. #include <i ...

  7. Ionic01 简单介绍、环境搭建、创建项目、项目结构、创建组件、创建页面、子页面跳转

    1 Ionic 基本介绍 Ionic 是一款基于 Angular.Cordova 的强大的 HTML5 移动应用开发框架 , 可以快速创建一个跨平台的移动应用.可以快速开发移动 App.移动端 WEB ...

  8. 443. String Compression字符串压缩

    [抄题]: Given an array of characters, compress it in-place. The length after compression must always b ...

  9. golang hello

    package main import "fmt" func main() { fmt.Printf("Hello, world.\n") }

  10. 使用 tpl 标签和 for 读取对象属性值中的数组

    来源于<sencha touch 权威指南> ----------------------------- 只摘抄app.js代码: Ext.require(['Ext.form.Panel ...