feat(expose): always expose $ instance properties on child refs

This commit is contained in:
Evan You
2021-06-24 21:28:09 -04:00
parent a5a66c5196
commit b0203a3092
5 changed files with 75 additions and 29 deletions

View File

@@ -19,6 +19,7 @@ import {
ComponentOptions,
createComponentInstance,
Data,
getExposeProxy,
setupComponent
} from './component'
import {
@@ -335,7 +336,7 @@ export const setRef = (
const refValue =
vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT
? vnode.component!.exposed || vnode.component!.proxy
? getExposeProxy(vnode.component!) || vnode.component!.proxy
: vnode.el
const value = isUnmount ? null : refValue