@@ -515,6 +515,7 @@ tester.run('v-if-else-key', rule, {
515
515
<template>
516
516
<div>
517
517
<ComponentA v-if="foo" />
518
+ <ComponentA v-else />
518
519
519
520
<ComponentA v-if="bar" />
520
521
<ComponentA v-else-if="baz" />
@@ -532,11 +533,12 @@ tester.run('v-if-else-key', rule, {
532
533
output : `
533
534
<template>
534
535
<div>
535
- <ComponentA v-if="foo" />
536
+ <ComponentA key="component-a-1" v-if="foo" />
537
+ <ComponentA key="component-a-2" v-else />
536
538
537
- <ComponentA key="component-a-1" v-if="bar" />
538
- <ComponentA key="component-a-2 " v-else-if="baz" />
539
- <ComponentA key="component-a-3 " v-else />
539
+ <ComponentA v-if="bar" />
540
+ <ComponentA key="component-a-4 " v-else-if="baz" />
541
+ <ComponentA key="component-a-5 " v-else />
540
542
</div>
541
543
</template>
542
544
<script>
@@ -551,17 +553,22 @@ tester.run('v-if-else-key', rule, {
551
553
{
552
554
message :
553
555
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute." ,
554
- line : 6
556
+ line : 4
555
557
} ,
556
558
{
557
559
message :
558
560
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute." ,
559
- line : 7
561
+ line : 5
560
562
} ,
561
563
{
562
564
message :
563
565
"Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute." ,
564
566
line : 8
567
+ } ,
568
+ {
569
+ message :
570
+ "Conditionally rendered repeated component 'ComponentA' expected to have a 'key' attribute." ,
571
+ line : 9
565
572
}
566
573
]
567
574
}
0 commit comments