# no-v-for-template-key

Rule `vue/no-v-for-template-key`. Disallow `key` attribute on `<template v-for>`

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2077 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-v-for-template-key` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-v-for-template-key.html) |

## Code examples

### Incorrect: the rule reports this

```vue
  <template v-for="item in list" :key="item.id">
    <div />
  </template>
</template>
```

### Correct: the rule accepts this

```vue
<template v-for="item in list">
  <div :key="item.id" />
</template>
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-v-for-template-key": "error",
    },
  },
];
```

## Related rules

- [vue/no-useless-mustaches](https://lintradar.dev/rules/vue/no-useless-mustaches.md): Disallow unnecessary mustache interpolations
- [vue/no-unused-properties](https://lintradar.dev/rules/vue/no-unused-properties.md): Disallow unused properties
- [vue/object-curly-newline](https://lintradar.dev/rules/vue/object-curly-newline.md): Enforce consistent line breaks after opening and before closing braces in `<template>`
- [vue/no-unsupported-features](https://lintradar.dev/rules/vue/no-unsupported-features.md): Disallow unsupported Vue.js syntax on the specified version
- [vue/padding-line-between-tags](https://lintradar.dev/rules/vue/padding-line-between-tags.md): Require or disallow newlines between sibling tags in template
- [vue/no-undef-components](https://lintradar.dev/rules/vue/no-undef-components.md): Disallow use of undefined components in `<template>`

---

Web page: https://lintradar.dev/rules/vue/no-v-for-template-key. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
