Vetur: Template tag cannot be keyed but vetur shows validation error that v-bind:key is required

Created on 26 Jun 2017  路  5Comments  路  Source: vuejs/vetur

  • Platform: Win
  • Vetur version: 0.8.6
  • VSCode version: 1.13.1

Problem

Template tag cannot be keyed but vetur shows validation error that v-bind:key is required

'v-for' directives require 'v-bind:key' directives.

image

Webpack won't compile when you put v-bind:key in template tag

duplicate

All 5 comments

273 #266 #261.

For now you can either disable this rule or disable template lint completely https://octref.github.io/vetur/linting-error.html

@octref - that link is dead, just saying.

New link is https://vuejs.github.io/vetur/linting-error.html since Vetur was moved to Vuejs organization.

From: https://vuejs.github.io/vetur/linting-error.html

Set ESLint rules in .eslintrc. An example:

{
  "extends": [
    "eslint:recommended",
    "plugin:vue/recommended"
  ],
  "rules": {
    "vue/html-self-closing": "off" // Fix v-for/template/key bug
  }
}
Was this page helpful?
0 / 5 - 0 ratings