Skip to content

Commit e44311f

Browse files
authored
fix: add emits options to defineComponent(fix #553) (#554)
1 parent acfeb39 commit e44311f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/component/componentOptions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export type ComponentOptionsWithProps<
7070
Props = ExtractPropTypes<PropsOptions>
7171
> = ComponentOptionsBase<Props, D, C, M> & {
7272
props?: PropsOptions
73+
emits?: string[] | Record<string, null | ((emitData: any) => boolean) >
7374
setup?: SetupFunction<Props, RawBindings>
7475
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M>>
7576

@@ -82,6 +83,7 @@ export type ComponentOptionsWithArrayProps<
8283
Props = Readonly<{ [key in PropNames]?: any }>
8384
> = ComponentOptionsBase<Props, D, C, M> & {
8485
props?: PropNames[]
86+
emits?: string[] | Record<string, null | ((emitData: any) => boolean)>
8587
setup?: SetupFunction<Props, RawBindings>
8688
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M>>
8789

@@ -93,6 +95,7 @@ export type ComponentOptionsWithoutProps<
9395
M extends MethodOptions = {}
9496
> = ComponentOptionsBase<Props, D, C, M> & {
9597
props?: undefined
98+
emits?: string[] | Record<string, null | ((emitData: any) => boolean)>
9699
setup?: SetupFunction<Props, RawBindings>
97100
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M>>
98101

0 commit comments

Comments
 (0)