fix(runtime-core): align $parent/$root with the template ref when using expose (#3158)

This commit is contained in:
HcySunYang
2021-02-07 21:39:52 +08:00
committed by GitHub
parent 3efa2aff13
commit f43a3b0beb
3 changed files with 45 additions and 6 deletions

View File

@@ -510,6 +510,10 @@ export function validateComponentName(name: string, config: AppConfig) {
}
}
export function isStatefulComponent(instance: ComponentInternalInstance) {
return instance.vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT
}
export let isInSSRComponentSetup = false
export function setupComponent(
@@ -518,8 +522,8 @@ export function setupComponent(
) {
isInSSRComponentSetup = isSSR
const { props, children, shapeFlag } = instance.vnode
const isStateful = shapeFlag & ShapeFlags.STATEFUL_COMPONENT
const { props, children } = instance.vnode
const isStateful = isStatefulComponent(instance)
initProps(instance, props, isStateful, isSSR)
initSlots(instance, children)