vue/no-v-text-v-html-on-component
禁止在组件上使用 v-text / v-html
- ⚙️ 此规则包含在所有
"plugin:vue/essential"
、*.configs["flat/vue2-essential"]
、"plugin:vue/vue3-essential"
、*.configs["flat/essential"]
、"plugin:vue/strongly-recommended"
、*.configs["flat/vue2-strongly-recommended"]
、"plugin:vue/vue3-strongly-recommended"
、*.configs["flat/strongly-recommended"]
、"plugin:vue/recommended"
、*.configs["flat/vue2-recommended"]
、"plugin:vue/vue3-recommended"
和*.configs["flat/recommended"]
中。
📖 规则详情
此规则禁止在组件上使用 v-text / v-html。
如果在组件上使用 v-text / v-html,它将覆盖组件的内容,并可能破坏组件。
🔧 选项
json
{
"vue/no-v-text-v-html-on-component": [
"error",
{ "allow": ["router-link", "nuxt-link"] }
]
}
allow
(string[]
) ... 指定规则不应应用到的自定义组件列表。
{ "allow": ["router-link", "nuxt-link"] }
🚀 版本
此规则是在 eslint-plugin-vue v8.4.0 中引入的