Skip to content

Commit 2dc5bbb

Browse files
committed
fix: useForm type error #4372
close #4372
1 parent 3da2b65 commit 2dc5bbb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/form/useForm.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ function useForm(
108108
resetFields: (newValues?: Props) => void;
109109
validate: <T = any>(names?: namesType, option?: validateOptions) => Promise<T>;
110110
validateField: (
111-
name?: string,
112-
value?: any,
113-
rules?: [Record<string, unknown>],
111+
name: string,
112+
value: any,
113+
rules: Record<string, unknown>[],
114114
option?: validateOptions,
115115
) => Promise<RuleError[]>;
116116
mergeValidateInfo: (items: ValidateInfo | ValidateInfo[]) => ValidateInfo;
@@ -236,8 +236,8 @@ function useForm(
236236
const validateField = (
237237
name: string,
238238
value: any,
239-
rules: any,
240-
option: validateOptions,
239+
rules: Record<string, unknown>[],
240+
option: validateOptions = {},
241241
): Promise<RuleError[]> => {
242242
const promise = validateRules(
243243
[name],

0 commit comments

Comments
 (0)