File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
packages/runtime-core/src/components Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -470,15 +470,17 @@ function getKeepAliveChild(vnode: VNode): VNode | undefined {
470470
471471 const { shapeFlag, children } = vnode
472472
473- if ( shapeFlag & ShapeFlags . ARRAY_CHILDREN ) {
474- return ( children as VNodeArrayChildren ) [ 0 ] as VNode
475- }
473+ if ( children ) {
474+ if ( shapeFlag & ShapeFlags . ARRAY_CHILDREN ) {
475+ return ( children as VNodeArrayChildren ) [ 0 ] as VNode
476+ }
476477
477- if (
478- shapeFlag & ShapeFlags . SLOTS_CHILDREN &&
479- isFunction ( ( children as any ) . default )
480- ) {
481- return ( children as any ) . default ( )
478+ if (
479+ shapeFlag & ShapeFlags . SLOTS_CHILDREN &&
480+ isFunction ( ( children as any ) . default )
481+ ) {
482+ return ( children as any ) . default ( )
483+ }
482484 }
483485}
484486
You can’t perform that action at this time.
0 commit comments