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

Function component

packages/runtime-core/src/apiCreateApp.ts:329–341  ·  view source on GitHub ↗
(name: string, component?: Component)

Source from the content-addressed store, hash-verified

327 },
328
329 component(name: string, component?: Component): any {
330 if (__DEV__) {
331 validateComponentName(name, context.config)
332 }
333 if (!component) {
334 return context.components[name]
335 }
336 if (__DEV__ && context.components[name]) {
337 warn(`Component "${name}" has already been registered in target app.`)
338 }
339 context.components[name] = component
340 return app
341 },
342
343 directive(name: string, directive?: Directive) {
344 if (__DEV__) {

Callers

nothing calls this directly

Calls 2

validateComponentNameFunction · 0.90
warnFunction · 0.90

Tested by

no test coverage detected