fix(compiler-sfc): support proper type arguments for defineEmit helper
fix #2874
This commit is contained in:
@@ -692,7 +692,7 @@ return { a, b, c, d, x }
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`SFC compile <script setup> with TypeScript defineEmit w/ type (union) 1`] = `
|
||||
exports[`SFC compile <script setup> with TypeScript defineEmit w/ type (type literal w/ call signatures) 1`] = `
|
||||
"import { defineComponent as _defineComponent } from 'vue'
|
||||
|
||||
|
||||
@@ -700,7 +700,7 @@ export default _defineComponent({
|
||||
expose: [],
|
||||
emits: [\\"foo\\", \\"bar\\", \\"baz\\"] as unknown as undefined,
|
||||
setup(__props, { emit }: {
|
||||
emit: (((e: 'foo' | 'bar') => void) | ((e: 'baz', id: number) => void)),
|
||||
emit: ({(e: 'foo' | 'bar'): void; (e: 'baz', id: number): void;}),
|
||||
slots: any,
|
||||
attrs: any
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user