fix(types): incorrect type inference of array (#4578)

This commit is contained in:
Amour1688
2021-09-22 00:41:10 +08:00
committed by GitHub
parent 58b1fa5ed1
commit 140f089917
2 changed files with 28 additions and 28 deletions

View File

@@ -41,7 +41,11 @@ export type DefineComponent<
E extends EmitsOptions = {},
EE extends string = string,
PP = PublicProps,
Props = Readonly<ExtractPropTypes<PropsOrPropOptions>> &
Props = Readonly<
PropsOrPropOptions extends ComponentPropsOptions
? ExtractPropTypes<PropsOrPropOptions>
: PropsOrPropOptions
> &
({} extends E ? {} : EmitsToProps<E>),
Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>
> = ComponentPublicInstanceConstructor<