From 2dc5bbbf43aea138e26fa411857278a4d34a0013 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 15 Jul 2021 21:20:00 +0800 Subject: [PATCH] fix: useForm type error #4372 close #4372 --- components/form/useForm.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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],