@@ -77,11 +77,11 @@ tester.run('valid-v-for', rule, {
77
77
} ,
78
78
{
79
79
filename : 'test.vue' ,
80
- code : '<template v-for="x of list"><slot name="item" /></template>'
80
+ code : '<template><template v-for="x of list"><slot name="item" /></template ></template>'
81
81
} ,
82
82
{
83
83
filename : 'test.vue' ,
84
- code : '<template v-for="x of list">foo<div></div></template>'
84
+ code : '<template><template v-for="x of list">foo<div></div></template ></template>'
85
85
} ,
86
86
{
87
87
filename : 'test.vue' ,
@@ -90,24 +90,30 @@ tester.run('valid-v-for', rule, {
90
90
{
91
91
filename : 'test.vue' ,
92
92
code : `
93
- <template v-for="x in xs">
94
- <template v-for="y in x.ys">
95
- <li v-for="z in y.zs" :key="z.id">
96
- 123
97
- </li>
93
+ <template>
94
+ <template v-for="x in xs">
95
+ <template v-for="y in x.ys">
96
+ <li v-for="z in y.zs" :key="z.id">
97
+ 123
98
+ </li>
99
+ </template>
98
100
</template>
99
- </template>`
101
+ </template>
102
+ `
100
103
} ,
101
104
{
102
105
filename : 'test.vue' ,
103
106
code : `
104
- <template v-for="x in xs">
105
- <template v-for="y in ys">
106
- <li v-for="z in zs" :key="x.id + y.id + z.id">
107
- 123
108
- </li>
107
+ <template>
108
+ <template v-for="x in xs">
109
+ <template v-for="y in ys">
110
+ <li v-for="z in zs" :key="x.id + y.id + z.id">
111
+ 123
112
+ </li>
113
+ </template>
109
114
</template>
110
- </template>`
115
+ </template>
116
+ `
111
117
}
112
118
] ,
113
119
invalid : [
@@ -215,38 +221,46 @@ tester.run('valid-v-for', rule, {
215
221
filename : 'test.vue' ,
216
222
errors : [ "Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive." ] ,
217
223
code : `
218
- <template v-for="x in xs">
219
- <template v-for="y in a.ys">
220
- <li v-for="z in y.zs" :key="z.id">
221
- 123
222
- </li>
224
+ <template>
225
+ <template v-for="x in xs">
226
+ <template v-for="y in a.ys">
227
+ <li v-for="z in y.zs" :key="z.id">
228
+ 123
229
+ </li>
230
+ </template>
223
231
</template>
224
- </template>`
232
+ </template>
233
+ `
225
234
} ,
226
235
{
227
236
filename : 'test.vue' ,
228
237
errors : [ "Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive." ] ,
229
238
code : `
230
- <template v-for="x in xs">
231
- <template v-for="y in x.ys">
232
- <li v-for="z in a.zs" :key="z.id">
233
- 123
234
- </li>
239
+ <template>
240
+ <template v-for="x in xs">
241
+ <template v-for="y in x.ys">
242
+ <li v-for="z in a.zs" :key="z.id">
243
+ 123
244
+ </li>
245
+ </template>
235
246
</template>
236
- </template>`
247
+ </template>
248
+ `
237
249
} ,
238
250
{
239
251
filename : 'test.vue' ,
240
252
errors : [ "Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive." ] ,
241
253
code : `
242
- <template v-for="x in xs">
243
- <template v-for="y in x.ys">
244
- <li v-for="z in x.zs" :key="z.id">
245
- 123
246
- </li>
254
+ <template>
255
+ <template v-for="x in xs">
256
+ <template v-for="y in x.ys">
257
+ <li v-for="z in x.zs" :key="z.id">
258
+ 123
259
+ </li>
260
+ </template>
247
261
</template>
248
- </template>`
262
+ </template>
263
+ `
249
264
}
250
-
251
265
]
252
266
} )
0 commit comments