createPlugin API
Factory for creating Vue plugins with typed dependency injection and lifecycle hooks.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createPlugin | Foundation |
| createContext | Foundation |
| createTrinity | Foundation |
| Plugins | Fundamentals |
Functions
bindPluginContext
(app: App<any>, namespace: string, context: unknown) => voidAttach a plugin context to the DevTools inspector record for namespace.
createPluginContext calls this after provide. Plugins that wrap
createPlugin directly (stack, date) must call it from provide.
createPluginContext
(defaultNamespace: string, factory: (options: Omit<O, PluginMeta>) => E, config?: PluginContextConfig<Omit<O, keyof PluginKeys>, E> | undefined) => readonly [<_E extends E = E>(_options?: O) => ContextTrinity<_E>, (_options?: O & Pick<PluginKeys, "devtools">) => Plugin, <_E extends E = E>(namespace?: string) => _E]Options
namespace required
stringprovide required
(app: App) => voidsetup
((app: App) => void) | undefineddevtools
boolean | undefinedWhen true, this plugin appears in the Vue DevTools v0 inspector.
Default: false
inspect
((context: unknown) => unknown) | undefinedOverlay keys onto the inspector snapshot (adapter names, method-backed state).