- defineEmits<EE>(emitOptions): EmitFn<EE[]>
Type Parameters
- EE extends string = string
Returns EmitFn<EE[]>
- defineEmits<E>(emitOptions): EmitFn<E>
Returns EmitFn<E>
- defineEmits<T>(): T extends ((...args: any[]) => any)
? T
: ShortEmits<T> Type Parameters
- T extends Record<string, any[]> | ((...args: any[]) => any)
Returns T extends ((...args: any[]) => any)
? T
: ShortEmits<T>
Vue
<script setup>
compiler macro for declaring a component's emitted events. The expected argument is the same as the componentemits
option.Example runtime declaration:
Example type-based declaration:
This is only usable inside
<script setup>
, is compiled away in the output and should not be actually called at runtime.