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

Method runWithContext

packages/runtime-core/src/apiCreateApp.ts:94–94  ·  view source on GitHub ↗

* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access * to variables provided via `app.provide()`. * * @param fn - function to run with the app as active instance

(fn: () => T)

Source from the content-addressed store, hash-verified

92 * @param fn - function to run with the app as active instance
93 */
94 runWithContext<T>(fn: () => T): T
95
96 // internal, but we need to expose these for the server-renderer and devtools
97 _uid: number

Callers 3

setupFunction · 0.80
apiInject.spec.tsFile · 0.80

Calls

no outgoing calls

Tested by 1

setupFunction · 0.64