vue/no-v-for-template-key-on-child
禁止将
<template v-for>
的 key 放置在子元素上
- ⚙️ 此规则包含在所有
"plugin:vue/vue3-essential"
、*.configs["flat/essential"]
、"plugin:vue/vue3-strongly-recommended"
、*.configs["flat/strongly-recommended"]
、"plugin:vue/vue3-recommended"
和*.configs["flat/recommended"]
中。
📖 规则详情
此规则报告放置在子元素上的 <template v-for>
的 key。
在 Vue.js 3.x 中,由于支持片段,<template v-for>
的 key 可以放置在 <template>
标签上。
有关更多详细信息,请参阅迁移指南 - key
属性 > 使用 <template v-for>
。
注意
此规则针对 Vue.js 3.x。如果您使用的是 Vue.js 2.x,请启用 vue/no-v-for-template-key 规则。不要同时启用这两个规则;它们是冲突的。
🔧 选项
无。
👫 相关规则
📚 延伸阅读
🚀 版本
此规则在 eslint-plugin-vue v7.0.0 中引入