refactor: remove unused inheritRef option

This is technically a breaking change, but the option was not meant for public use
and ended up not solving the problem it was introduced for.
This commit is contained in:
Evan You
2020-06-30 21:47:12 -04:00
parent 5c490f1c45
commit 7886c267f7
6 changed files with 22 additions and 23 deletions

View File

@@ -17,8 +17,7 @@ import {
ComponentInternalInstance,
createComponentInstance,
Data,
setupComponent,
Component
setupComponent
} from './component'
import {
renderComponentRoot,
@@ -283,14 +282,10 @@ export const setRef = (
if (!vnode) {
value = null
} else {
const { el, component, shapeFlag, type } = vnode
if (shapeFlag & ShapeFlags.COMPONENT && (type as Component).inheritRef) {
return
}
if (shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
value = component!.proxy
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
value = vnode.component!.proxy
} else {
value = el
value = vnode.el
}
}