Skip to content

Commit b92ea0a

Browse files
committed
wip: save
1 parent 5dce316 commit b92ea0a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/runtime-dom/src/components/Transition.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
assertNumber,
88
compatUtils,
99
h,
10+
isVNode,
1011
} from '@vue/runtime-core'
1112
import { extend, isArray, isObject, toNumber } from '@vue/shared'
1213

@@ -99,12 +100,20 @@ const decorate = (t: typeof Transition) => {
99100
* base Transition component, with DOM-specific logic.
100101
*/
101102
export const Transition: FunctionalComponent<TransitionProps> =
102-
/*@__PURE__*/ decorate((props, { slots, vapor }: any) => {
103+
/*@__PURE__*/ decorate((props, { slots }) => {
104+
const children = slots.default && slots.default()
105+
const isVNodeChildren = isArray(children) && children.some(c => isVNode(c))
103106
const resolvedProps = resolveTransitionProps(props)
104-
if (vapor) {
105-
return vaporTransitionImpl!.applyTransition(resolvedProps, slots)
107+
if (isVNodeChildren) {
108+
return h(BaseTransition, resolvedProps, {
109+
default: () => children,
110+
})
106111
}
107-
return h(BaseTransition, resolvedProps, slots)
112+
113+
// vapor transition
114+
return vaporTransitionImpl!.applyTransition(resolvedProps, {
115+
default: () => children,
116+
})
108117
})
109118

110119
/**

0 commit comments

Comments
 (0)