fix(runtime-core): fix instance accessed via $parent chain when using expose() (#4048)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
ComponentInternalInstance,
|
||||
Data,
|
||||
getExposeProxy,
|
||||
isStatefulComponent
|
||||
} from './component'
|
||||
import { nextTick, queueJob } from './scheduler'
|
||||
@@ -217,7 +218,7 @@ const getPublicInstance = (
|
||||
i: ComponentInternalInstance | null
|
||||
): ComponentPublicInstance | ComponentInternalInstance['exposed'] | null => {
|
||||
if (!i) return null
|
||||
if (isStatefulComponent(i)) return i.exposed ? i.exposed : i.proxy
|
||||
if (isStatefulComponent(i)) return getExposeProxy(i) || i.proxy
|
||||
return getPublicInstance(i.parent)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user