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

Function emit

packages/runtime-core/src/compat/instanceEventEmitter.ts:94–109  ·  view source on GitHub ↗
(
  instance: ComponentInternalInstance,
  event: string,
  args: any[],
)

Source from the content-addressed store, hash-verified

92}
93
94export function emit(
95 instance: ComponentInternalInstance,
96 event: string,
97 args: any[],
98): ComponentPublicInstance | null {
99 const cbs = getRegistry(instance)[event]
100 if (cbs) {
101 callWithAsyncErrorHandling(
102 cbs.map(cb => cb.bind(instance.proxy)),
103 instance,
104 ErrorCodes.COMPONENT_EVENT_HANDLER,
105 args,
106 )
107 }
108 return instance.proxy
109}

Callers

nothing calls this directly

Calls 3

getRegistryFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected