(vnode: VNode)
| 507 | } |
| 508 | |
| 509 | function getInnerChild(vnode: VNode): VNode | undefined { |
| 510 | if (!isKeepAlive(vnode)) { |
| 511 | if (isTeleport(vnode.type) && vnode.children) { |
| 512 | return findNonCommentChild(vnode.children as VNode[]) |
| 513 | } |
| 514 | |
| 515 | return vnode |
| 516 | } |
| 517 | // #7121,#12465 get the component subtree if it's been mounted |
| 518 | if (vnode.component) { |
| 519 | return vnode.component.subTree |
| 520 | } |
| 521 | |
| 522 | const { shapeFlag, children } = vnode |
| 523 | |
| 524 | if (children) { |
| 525 | if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) { |
| 526 | return (children as VNodeArrayChildren)[0] as VNode |
| 527 | } |
| 528 | |
| 529 | if ( |
| 530 | shapeFlag & ShapeFlags.SLOTS_CHILDREN && |
| 531 | isFunction((children as any).default) |
| 532 | ) { |
| 533 | return (children as any).default() |
| 534 | } |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | export function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void { |
| 539 | if (vnode.shapeFlag & ShapeFlags.COMPONENT && vnode.component) { |
no test coverage detected