refactor: adjust logic branches
This commit is contained in:
parent
7562e72c2b
commit
69304cf166
@ -316,16 +316,15 @@ export const setRef = (
|
|||||||
if (!vnode) {
|
if (!vnode) {
|
||||||
// means unmount
|
// means unmount
|
||||||
value = null
|
value = null
|
||||||
} else {
|
} else if (isAsyncWrapper(vnode)) {
|
||||||
// when mounting async components, nothing needs to be done,
|
// when mounting async components, nothing needs to be done,
|
||||||
// because the template ref is forwarded to inner component
|
// because the template ref is forwarded to inner component
|
||||||
if (isAsyncWrapper(vnode)) return
|
return
|
||||||
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
|
} else if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
|
||||||
value = vnode.component!.exposed || vnode.component!.proxy
|
value = vnode.component!.exposed || vnode.component!.proxy
|
||||||
} else {
|
} else {
|
||||||
value = vnode.el
|
value = vnode.el
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const { i: owner, r: ref } = rawRef
|
const { i: owner, r: ref } = rawRef
|
||||||
if (__DEV__ && !owner) {
|
if (__DEV__ && !owner) {
|
||||||
|
Loading…
Reference in New Issue
Block a user