Skip to content

vue/no-root-v-if

禁止在根元素上使用 v-if 指令

¥disallow v-if directives on root element

此规则报告带有 v-if 的模板根。整个组件的渲染可以在父组件中设置为有条件的(使用 v-if)。

¥This rule reports template roots with v-if. Rendering of the whole component could be made conditional in the parent component (with a v-if there) instead.

📖 规则详情

此规则在以下情况下报告模板根:

¥This rule reports the template root in the following cases:

Now loading...

🔧选项

¥🔧 Options

无。

¥Nothing.

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v9.12.0 中引入

¥This rule was introduced in eslint-plugin-vue v9.12.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号