-
- Notifications
You must be signed in to change notification settings - Fork 696
Closed
Labels
Description
Self-closing elements break the following rules:
- vue/no-invalid-template-root
- vue/no-invalid-v-else-if
- vue/no-invalid-v-else
Expected
This should not be reported:
<template> <c1 v-if="1" /> <c2 v-else-if="1" /> <c3 v-else /> </template>
Happening
This works:
<template> <c1 v-if="1"></c1> <c2 v-else-if="1"></c2> <c3 v-else></c3> </template>
This doesn't:
<template> <c1 v-if="1" /> <c2 v-else-if="1" /> <c3 v-else /> </template>
Here are the report messages:
26:3 error The template root requires the next element which has 'v-else' directives if it has 'v-if' directives vue/no-invalid-template-root 27:7 error 'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive vue/no-invalid-v-else-if 28:7 error 'v-else' directives require being preceded by the element which has a 'v-if' or 'v-else' directive vue/no-invalid-v-else