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

Function use

packages/runtime-core/src/apiCreateApp.ts:295–311  ·  view source on GitHub ↗
(plugin: Plugin, ...options: any[])

Source from the content-addressed store, hash-verified

293 },
294
295 use(plugin: Plugin, ...options: any[]) {
296 if (installedPlugins.has(plugin)) {
297 __DEV__ && warn(`Plugin has already been applied to target app.`)
298 } else if (plugin && isFunction(plugin.install)) {
299 installedPlugins.add(plugin)
300 plugin.install(app, ...options)
301 } else if (isFunction(plugin)) {
302 installedPlugins.add(plugin)
303 plugin(app, ...options)
304 } else if (__DEV__) {
305 warn(
306 `A plugin must either be a function or an object with an "install" ` +
307 `function.`,
308 )
309 }
310 return app
311 },
312
313 mixin(mixin: ComponentOptions) {
314 if (__FEATURE_OPTIONS_API__) {

Callers

nothing calls this directly

Calls 5

warnFunction · 0.90
isFunctionFunction · 0.90
pluginFunction · 0.85
hasMethod · 0.80
installMethod · 0.80

Tested by

no test coverage detected