fix: useForm type error #4372

close #4372
pull/4385/head
tangjinzhou 3 years ago
parent 3da2b65fd8
commit 2dc5bbbf43

@ -108,9 +108,9 @@ function useForm(
resetFields: (newValues?: Props) => void; resetFields: (newValues?: Props) => void;
validate: <T = any>(names?: namesType, option?: validateOptions) => Promise<T>; validate: <T = any>(names?: namesType, option?: validateOptions) => Promise<T>;
validateField: ( validateField: (
name?: string, name: string,
value?: any, value: any,
rules?: [Record<string, unknown>], rules: Record<string, unknown>[],
option?: validateOptions, option?: validateOptions,
) => Promise<RuleError[]>; ) => Promise<RuleError[]>;
mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo; mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo;
@ -236,8 +236,8 @@ function useForm(
const validateField = ( const validateField = (
name: string, name: string,
value: any, value: any,
rules: any, rules: Record<string, unknown>[],
option: validateOptions, option: validateOptions = {},
): Promise<RuleError[]> => { ): Promise<RuleError[]> => {
const promise = validateRules( const promise = validateRules(
[name], [name],

Loading…
Cancel
Save