Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 645 Bytes

no-template-key.md

File metadata and controls

34 lines (25 loc) · 645 Bytes

Disallow 'key' attribute on '' (no-template-key)

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

📖 Rule Details

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

👎 Examples of incorrect code for this rule:

<template>
    <div>
        <template key="x"></template>
        <template v-bind:key="y"></template>
        <template :key="z"></template>
    </div>
</template>

👍 Examples of correct code for this rule:

<template>
    <div>
        <div key="x"></div>
        <template></template>
    </div>
</template>

🔧 Options

Nothing.