Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 934 Bytes

no-root-v-if.md

File metadata and controls

40 lines (26 loc) · 934 Bytes
pageClass sidebarDepth title description since
rule-details
0
vue/no-root-v-if
disallow `v-if` directives on root element
v9.12.0

vue/no-root-v-if

disallow v-if directives on root element

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.

📖 Rule Details

This rule reports the template root in the following cases:

<template>
  <div v-if="foo"></div>
</template>

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation