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

Function directive

packages/runtime-core/src/apiCreateApp.ts:343–356  ·  view source on GitHub ↗
(name: string, directive?: Directive)

Source from the content-addressed store, hash-verified

341 },
342
343 directive(name: string, directive?: Directive) {
344 if (__DEV__) {
345 validateDirectiveName(name)
346 }
347
348 if (!directive) {
349 return context.directives[name] as any
350 }
351 if (__DEV__ && context.directives[name]) {
352 warn(`Directive "${name}" has already been registered in target app.`)
353 }
354 context.directives[name] = directive
355 return app
356 },
357
358 mount(
359 rootContainer: HostElement,

Callers

nothing calls this directly

Calls 2

validateDirectiveNameFunction · 0.90
warnFunction · 0.90

Tested by

no test coverage detected