Skip to content

Commit cc15a67

Browse files
committed
chore: small tweaks
1 parent 28f135f commit cc15a67

File tree

1 file changed

+2
-11
lines changed
  • packages/compiler-core/src/transforms

1 file changed

+2
-11
lines changed

packages/compiler-core/src/transforms/vIf.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,9 @@ export function processIf(
141141
}
142142

143143
if (sibling && sibling.type === NodeTypes.IF) {
144-
// Check if v-else was followed by v-else-if
144+
// Check if v-else was followed by v-else-if or there are two adjacent v-else
145145
if (
146-
dir.name === 'else-if' &&
147-
sibling.branches[sibling.branches.length - 1].condition === undefined
148-
) {
149-
context.onError(
150-
createCompilerError(ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc),
151-
)
152-
}
153-
// Check that there should not be two adjacent v-else
154-
if (
155-
dir.name === 'else' &&
146+
(dir.name === 'else-if' || dir.name === 'else') &&
156147
sibling.branches[sibling.branches.length - 1].condition === undefined
157148
) {
158149
context.onError(

0 commit comments

Comments
 (0)