File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,19 @@ This rule checks whether every template root is valid.
6
6
7
7
This rule reports the template root if the following cases:
8
8
9
+ - The root is nothing. E.g. ` <template></template> ` .
9
10
- The root is text. E.g. ` <template>hello</template> ` .
10
11
- The root is multiple elements. E.g. ` <template><div>one</div><div>two</div></template> ` .
11
12
- 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> ` .
13
13
- The root element is ` <template> ` or ` <slot> ` elements. E.g. ` <template><template>hello</template></template> ` .
14
14
15
15
👎 Examples of ** incorrect** code for this rule:
16
16
17
+ ``` html
18
+ <template >
19
+ </template >
20
+ ```
21
+
17
22
``` html
18
23
<template >
19
24
<div >hello</div >
@@ -33,17 +38,17 @@ This rule reports the template root if the following cases:
33
38
</template >
34
39
```
35
40
41
+ 👍 Examples of ** correct** code for this rule:
42
+
36
43
``` html
37
44
<template >
38
- <div v-if = " foo " > </div >
45
+ <div >abc </div >
39
46
</template >
40
47
```
41
48
42
- 👍 Examples of ** correct** code for this rule:
43
-
44
49
``` html
45
50
<template >
46
- <div >abc </div >
51
+ <div v-if = " foo " > </div >
47
52
</template >
48
53
```
49
54
You can’t perform that action at this time.
0 commit comments