Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.16 KB

no-template-key.md

File metadata and controls

46 lines (32 loc) · 1.16 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-template-key
disallow `key` attribute on `<template>`

vue/no-template-key

disallow key attribute on <template>

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

Vue.js disallows key attribute on <template> elements.

📖 Rule Details

This rule reports the <template> elements which have key attribute.

<template>
  <!-- ✓ GOOD -->
  <div key="foo"> ... </div>
  <template> ... </template>

  <!-- ✗ BAD -->
  <template key="foo"> ... </template>
  <template v-bind:key="bar"> ... </template>
  <template :key="baz"> ... </template>
</template>

🔧 Options

Nothing.

📚 Further reading

🔍 Implementation