Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.61 KB

valid-template-root.md

File metadata and controls

77 lines (54 loc) · 1.61 KB
pageClass sidebarDepth title description
rule-details
0
vue/valid-template-root
enforce valid template root

vue/valid-template-root

enforce valid template root

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-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:

<!-- There is no root element -->
<template></template>
<!-- The root is text -->
<template>Lorem ipsum</template>
<!-- There are multiple root elements -->
<template>
  <div>hello</div>
  <div>hello</div>
</template>
<!-- The root element has `v-for` directives -->
<template>
  <div v-for="item in items"/>
</template>
<!-- The root element is `<template>` or `<slot>` -->
<template>
  <slot />
</template>

🔧 Options

Nothing.

🔍 Implementation