type ComponentInternalInstance,
type ConcreteComponent,
type Data,
- getExposeProxy,
+ getComponentPublicInstance,
validateComponentName,
} from './component'
import type {
devtoolsInitApp(app, version)
}
- return getExposeProxy(vnode.component!) || vnode.component!.proxy
+ return getComponentPublicInstance(vnode.component!)
} else if (__DEV__) {
warn(
`App has already been mounted.\n` +
exposed: null,
exposeProxy: null,
withProxy: null,
+
provides: parent ? parent.provides : Object.create(appContext.provides),
accessCache: null!,
renderCache: [],
}
}
-export function getExposeProxy(instance: ComponentInternalInstance) {
+export function getComponentPublicInstance(
+ instance: ComponentInternalInstance,
+) {
if (instance.exposed) {
return (
instance.exposeProxy ||
},
}))
)
+ } else {
+ return instance.proxy
}
}
import {
type ComponentInternalInstance,
type Data,
- getExposeProxy,
+ getComponentPublicInstance,
isStatefulComponent,
} from './component'
import { nextTick, queueJob } from './scheduler'
i: ComponentInternalInstance | null,
): ComponentPublicInstance | ComponentInternalInstance['exposed'] | null => {
if (!i) return null
- if (isStatefulComponent(i)) return getExposeProxy(i) || i.proxy
+ if (isStatefulComponent(i)) return getComponentPublicInstance(i)
return getPublicInstance(i.parent)
}
import {
type ComponentInternalInstance,
type Data,
- getExposeProxy,
+ getComponentPublicInstance,
} from './component'
import { currentRenderingInstance } from './componentRenderContext'
import { ErrorCodes, callWithAsyncErrorHandling } from './errorHandling'
import { traverse } from './apiWatch'
export interface DirectiveBinding<V = any> {
- instance: ComponentPublicInstance | null
+ instance: ComponentPublicInstance | Record<string, any> | null
value: V
oldValue: V | null
arg?: string
__DEV__ && warn(`withDirectives can only be used inside render functions.`)
return vnode
}
- const instance =
- (getExposeProxy(currentRenderingInstance) as ComponentPublicInstance) ||
- currentRenderingInstance.proxy
+ const instance = getComponentPublicInstance(currentRenderingInstance)
const bindings: DirectiveBinding[] = vnode.dirs || (vnode.dirs = [])
for (let i = 0; i < directives.length; i++) {
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]
remove,
} from '@vue/shared'
import { isAsyncWrapper } from './apiAsyncComponent'
-import { getExposeProxy } from './component'
import { warn } from './warning'
import { isRef } from '@vue/reactivity'
import { ErrorCodes, callWithErrorHandling } from './errorHandling'
import type { SchedulerJob } from './scheduler'
import { queuePostRenderEffect } from './renderer'
+import { getComponentPublicInstance } from './component'
/**
* Function for handling a template ref
const refValue =
vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT
- ? getExposeProxy(vnode.component!) || vnode.component!.proxy
+ ? getComponentPublicInstance(vnode.component!)
: vnode.el
const value = isUnmount ? null : refValue