feat(runtime-core): explicit expose API

This commit is contained in:
Evan You
2020-11-14 12:49:35 -05:00
parent 15baaf14f0
commit 0e59770b92
4 changed files with 132 additions and 7 deletions

View File

@@ -306,12 +306,12 @@ export const setRef = (
return
}
let value: ComponentPublicInstance | RendererNode | null
let value: ComponentPublicInstance | RendererNode | Record<string, any> | null
if (!vnode) {
value = null
} else {
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
value = vnode.component!.proxy
value = vnode.component!.exposed || vnode.component!.proxy
} else {
value = vnode.el
}