diff --git a/components/form/useForm.ts b/components/form/useForm.ts index 236031dd3..a8c82f65c 100644 --- a/components/form/useForm.ts +++ b/components/form/useForm.ts @@ -108,9 +108,9 @@ function useForm( resetFields: (newValues?: Props) => void; validate: (names?: namesType, option?: validateOptions) => Promise; validateField: ( - name?: string, - value?: any, - rules?: [Record], + name: string, + value: any, + rules: Record[], option?: validateOptions, ) => Promise; mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo; @@ -236,8 +236,8 @@ function useForm( const validateField = ( name: string, value: any, - rules: any, - option: validateOptions, + rules: Record[], + option: validateOptions = {}, ): Promise => { const promise = validateRules( [name],