pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/no-template-key |
disallow `key` attribute on `<template>` |
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.
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>
Nothing.