Appearance
vue/no-multiple-template-root
禁止向模板添加多个根节点
- ⚙️ 此规则包含在
"plugin:vue/vue2-essential"、*.configs["flat/vue2-essential"]、"plugin:vue/vue2-strongly-recommended"、*.configs["flat/vue2-strongly-recommended"]、"plugin:vue/vue2-recommended"和*.configs["flat/vue2-recommended"]中。
📖 规则详情
此规则检查模板是否包含对 Vue 2 有效的单个根元素。
¥This rule checks whether template contains single root element valid for Vue 2.
🔧选项
¥🔧 Options
json
{
"vue/no-multiple-template-root": ["error", {
"disallowComments": false
}]
}"disallowComments" (
boolean) 启用模板根目录中不应包含任何注释。默认值为false。¥"disallowComments" (
boolean) Enables there should not be any comments in the template root. Default isfalse.
"disallowComments":true
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation