Skip to content

Commit

Permalink
fix(runtime-core): getKeepAliveChild support slot
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoErii committed Apr 16, 2024
1 parent 46c2b63 commit 5f3c04d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/components/BaseTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ErrorCodes, callWithAsyncErrorHandling } from '../errorHandling'
import { PatchFlags, ShapeFlags, isArray } from '@vue/shared'
import { onBeforeUnmount, onMounted } from '../apiLifecycle'
import type { RendererElement } from '../renderer'
import type { RawSlots, Slot } from '../componentSlots'

type Hook<T = () => void> = T | T[]

Expand Down Expand Up @@ -465,7 +466,8 @@ function getKeepAliveChild(vnode: VNode): VNode | undefined {
__DEV__ && vnode.component
? vnode.component.subTree
: vnode.children
? ((vnode.children as VNodeArrayChildren)[0] as VNode)
? ((vnode.children as VNodeArrayChildren)[0] as VNode) ||
((vnode.children as RawSlots).default as Slot)()
: undefined
: vnode
}
Expand Down

0 comments on commit 5f3c04d

Please sign in to comment.