pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/no-root-v-if |
enforce valid `v-if` directives on root element |
enforce valid
v-if
directives on root element
- ❗ This rule has not been released yet.
- ⚙️ This rule is included in all of
"plugin:vue/vue3-essential"
,"plugin:vue/essential"
,"plugin:vue/vue3-strongly-recommended"
,"plugin:vue/strongly-recommended"
,"plugin:vue/vue3-recommended"
and"plugin:vue/recommended"
.
This rule checks whether every template root is valid.
This rule reports the template root in the following cases:
<!-- `v-if` should not be used on root element without `v-else` -->
<template>
<div v-if="foo"></div>
</template>
<template><custom-component v-if="shouldShow" /></template>
Nothing.