Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8dd93d

Browse files
update docs
1 parent f220c0d commit d8dd93d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎docs/rules/no-invalid-template-root.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ This rule checks whether every template root is valid.
66

77
This rule reports the template root if the following cases:
88

9+
- The root is nothing. E.g. `<template></template>`.
910
- The root is text. E.g. `<template>hello</template>`.
1011
- The root is multiple elements. E.g. `<template><div>one</div><div>two</div></template>`.
1112
- The root element has `v-for` directives. E.g. `<template><div v-for="x in list">{{x}}</div></template>`.
12-
- The root element has `v-if`/`v-else-if` directives without `v-else` elements. E.g. `<template><div v-if="foo">hello</div></template>`.
1313
- The root element is `<template>` or `<slot>` elements. E.g. `<template><template>hello</template></template>`.
1414

1515
👎 Examples of **incorrect** code for this rule:
1616

17+
```html
18+
<template>
19+
</template>
20+
```
21+
1722
```html
1823
<template>
1924
<div>hello</div>
@@ -33,17 +38,17 @@ This rule reports the template root if the following cases:
3338
</template>
3439
```
3540

41+
👍 Examples of **correct** code for this rule:
42+
3643
```html
3744
<template>
38-
<divv-if="foo"></div>
45+
<div>abc</div>
3946
</template>
4047
```
4148

42-
👍 Examples of **correct** code for this rule:
43-
4449
```html
4550
<template>
46-
<div>abc</div>
51+
<divv-if="foo"></div>
4752
</template>
4853
```
4954

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /