# san/no-multiple-template-root

不允许向模板添加多个根节点

  • ⚙️ 此规则包含于 "plugin:san/essential", "plugin:san/strongly-recommended""plugin:san/recommended".

# 📖 规则细节

此规则检查 San 中的 template 是否只包含单个根元素。

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

# 🔧 配置

暂无。

# 🔍 实现