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

<p v-for="line in lines">
{{line}}
</p>

搜索了一下找到了这个讨论https://github.com/vuejs/vetur/issues/261

原来这是 ESLint 的一个 feature,但是我也没启用 ESLint 呀。原来是因为 vetur(Vue.JS 的高亮插件)里自带了 ESLint。

解决方法是打开 VSCode 的 Preferences 里的 Settings,搜索 ESLint,在 Vetur › Validation: Template 下面取消选中 Validate vue-html in <template> using eslint-plugin-vue 即可。

v-for 在 VSCode 中出现 Elements in iteration expect to have 'v-bind:key' directives.的更多相关文章

  1. 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+的版本里,当在组件 ...

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

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

  3. 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+的版本里, ...

  4. 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 ...

  5. 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 ...

  6. [vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives.

    使用VScode开发vue中,v-for在Eslint的规则检查下出现报错:如下Elements in iteration expect to have ‘v-bind:key’ directives ...

  7. 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 ...

  8. Elements in iteration expect to have 'v-bind:key' directives错误的解决办法

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

  9. 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 ...

随机推荐

  1. 回顾曾经的自己,献给java初学者的建议

    要不惜代价投资自己,任何对自己的投资都是值得的 要多学习数据结构, 习惯看源码! 一份知识经过n个人的传递早已经不成样子了 遇到问题不要直接百度,百度上那些花里胡哨的东西有用的很少,对症下药才是王道, ...

  2. js常用JSON数据操作

    JSON字符串: var  str = '{"name": "jack", "age": 13}'; JSON对象: var obj = { ...

  3. thinkphp5路由心得

    路由的作用:1. 简化URL地址,方便大家记忆2. 有利于搜索引擎的优化,比如可以被百度的爬虫抓取到 优化URl1. 前后端分离修改入口文件,在public下新建admin.php文件,将下面的代码添 ...

  4. jsp内置对象-pageContext对象

    1.概念:pageContext对象能够获取JSP页面中的request.response.session.application等其他内置对象.pageContext对象的创建和初始化由容器完成,可 ...

  5. Dynamics CRM项目实例之九:CRM 2015的产品中的捆绑销售

    关注本人微信和易信公众号: 微软动态CRM专家罗勇,回复140或者20150112可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me!      今天的博客主要是介绍Dy ...

  6. springboot2.0拦截器和webconfigure配置

    接下来介绍一下springboot如何配置拦截器,很简单,只需要两个配置文件就可以了 首先配置登陆拦截器 @Component public class LoginInterceptor implem ...

  7. .Net Core 学习笔记1——包、元包、框架

    .Net Core 是由NuGet包(package)组成的平台. 一起使用的多个包的集合:元包(Metapackage) package 包 (对应以前的程序集概念) Framework 框架 as ...

  8. MyDAL - .UpdateAsync() 之 .Set() 使用

    索引: 目录索引 一.API 列表 1.Set<M, F>(Expression<Func<M, F>> propertyFunc, F newVal) 如: .S ...

  9. iOS NFC

    #import <CoreNFC/CoreNFC.h> @interface ViewController ()<NFCNDEFReaderSessionDelegate> @ ...

  10. 下载合适的tomcat版本

    Tomcat因技术先进.性能稳定,而且免费,因而深受Java爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器.对于新手来讲,如何下载合适的tomcat版本呢?今天我们以下 ...