Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 1.6 KB

no-multiple-template-root.md

File metadata and controls

72 lines (50 loc) · 1.6 KB
pageClass sidebarDepth title description since
rule-details
0
vue/no-multiple-template-root
disallow adding multiple root nodes to the template
v7.0.0

vue/no-multiple-template-root

disallow adding multiple root nodes to the template

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

📖 Rule Details

This rule checks whether template contains single root element valid for Vue 2.

<!-- 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.

🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation