|
@@ -6,7 +6,7 @@ import {
|
|
|
isInSSRComponentSetup,
|
|
isInSSRComponentSetup,
|
|
|
ComponentOptions
|
|
ComponentOptions
|
|
|
} from './component'
|
|
} from './component'
|
|
|
-import { isFunction, isObject } from '@vue/shared'
|
|
|
|
|
|
|
+import { isFunction, isObject, ShapeFlags } from '@vue/shared'
|
|
|
import { ComponentPublicInstance } from './componentPublicInstance'
|
|
import { ComponentPublicInstance } from './componentPublicInstance'
|
|
|
import { createVNode, VNode } from './vnode'
|
|
import { createVNode, VNode } from './vnode'
|
|
|
import { defineComponent } from './apiDefineComponent'
|
|
import { defineComponent } from './apiDefineComponent'
|
|
@@ -211,10 +211,14 @@ export function defineAsyncComponent<
|
|
|
|
|
|
|
|
function createInnerComp(
|
|
function createInnerComp(
|
|
|
comp: ConcreteComponent,
|
|
comp: ConcreteComponent,
|
|
|
- { vnode: { ref, props, children } }: ComponentInternalInstance
|
|
|
|
|
|
|
+ { vnode: { ref, props, children }, parent }: ComponentInternalInstance
|
|
|
) {
|
|
) {
|
|
|
const vnode = createVNode(comp, props, children)
|
|
const vnode = createVNode(comp, props, children)
|
|
|
// ensure inner component inherits the async wrapper's ref owner
|
|
// ensure inner component inherits the async wrapper's ref owner
|
|
|
vnode.ref = ref
|
|
vnode.ref = ref
|
|
|
|
|
+
|
|
|
|
|
+ if (parent && isKeepAlive(parent.vnode)) {
|
|
|
|
|
+ vnode.shapeFlag |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
|
|
|
|
|
+ }
|
|
|
return vnode
|
|
return vnode
|
|
|
}
|
|
}
|