Browse Source

fix: useForm type error #4372

close #4372
pull/4385/head
tangjinzhou 3 years ago
parent
commit
2dc5bbbf43
  1. 10
      components/form/useForm.ts

10
components/form/useForm.ts

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

Loading…
Cancel
Save