//格式:defineEmits<{(e:事件名,val:資料型別):void}>()
const emit = defineEmits<{ (e: 'get-msg', val: string): void, (e: 'say-hello', num: number): void }>() const fn = () => { emit('get-msg', '你好') } const fns = () => { emit('say-hello', 11) }
const emit = defineEmits<{ (e: 'get-msg', val: string): void, (e: 'say-hello', num: number): void }>() const fn = () => { emit('get-msg', '你好') } const fns = () => { emit('say-hello', 11) }