MCPcopy
hub / github.com/vuejs/core / setCurrentInstance

Function setCurrentInstance

packages/runtime-core/src/component.ts:773–781  ·  view source on GitHub ↗
(instance: ComponentInternalInstance)

Source from the content-addressed store, hash-verified

771}
772
773export const setCurrentInstance = (instance: ComponentInternalInstance) => {
774 const prev = currentInstance
775 internalSetCurrentInstance(instance)
776 instance.scope.on()
777 return (): void => {
778 instance.scope.off()
779 internalSetCurrentInstance(prev)
780 }
781}
782
783export const unsetCurrentInstance = (): void => {
784 currentInstance && currentInstance.scope.off()

Callers 6

restoreFunction · 0.90
injectHookFunction · 0.90
instanceWatchFunction · 0.90
resolvePropValueFunction · 0.90
setupStatefulComponentFunction · 0.85
finishComponentSetupFunction · 0.85

Calls 2

onMethod · 0.65
offMethod · 0.65

Tested by

no test coverage detected