Skip to content

Commit 0a1c469

Browse files
committed
fix(compiler-vapor): Transition accepts template tags
1 parent c245dae commit 0a1c469

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/compiler-vapor/__tests__/transforms/TransformTransition.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('compiler: transition', () => {
127127
<template v-else></template>
128128
</transition>
129129
`,
130-
true,
130+
false,
131131
)
132132
})
133133

packages/compiler-vapor/src/transforms/transformTransition.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function hasMultipleChildren(node: ElementNode): boolean {
3636
if (
3737
children.length === 1 &&
3838
first.type === NodeTypes.ELEMENT &&
39-
(findDir(first, 'for') || isTemplateNode(first))
39+
findDir(first, 'for')
4040
) {
4141
return true
4242
}
@@ -49,8 +49,8 @@ function hasMultipleChildren(node: ElementNode): boolean {
4949
children.every(
5050
(c, index) =>
5151
c.type === NodeTypes.ELEMENT &&
52-
// not template
53-
!isTemplateNode(c) &&
52+
(!isTemplateNode(c) ||
53+
(isTemplateNode(c) && !hasMultipleChildren(c))) &&
5454
// not has v-for
5555
!findDir(c, 'for') &&
5656
// if the first child has v-if, the rest should also have v-else-if/v-else

0 commit comments

Comments
 (0)