-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
Add an element with a v-if condition.
Add a v-else element right after it.
Add one or more additional v-else elements after that.
Only the last v-else is recognized. The rest are silently ignored.
What is expected?
This syntax should either:
- throw a compile-time error, or
- trigger a warning, or
- at the very least, be caught by the Vue ESLint plugin as invalid usage.
Allowing multiple v-else blocks after a single v-if is logically invalid and likely always unintentional. It can lead to subtle bugs and confusion during development.
What is actually happening?
No errors or warnings are shown. Only the last v-else is used, and the rest are ignored without any indication.
This makes it easy to introduce bugs, especially in larger templates or when components are modified over time.
System Info
Any additional comments?
No response