Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.24 KB

no-root-v-if.md

File metadata and controls

40 lines (27 loc) · 1.24 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-root-v-if
enforce valid `v-if` directives on root element

vue/no-root-v-if

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.

📖 Rule Details

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>

🔧 Options

Nothing.

🔍 Implementation