From 0a404e88b7d018980d6285fda5aa0bc85847fc24 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Wed, 8 Dec 2021 14:56:57 +0800 Subject: [PATCH] fix: formItem name type #4998 close #4998 --- components/form/FormItem.tsx | 4 ++-- components/form/context.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index e237aa98a..c0405b04c 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -84,8 +84,8 @@ export const formItemProps = { hasFeedback: PropTypes.looseBool.def(false), colon: PropTypes.looseBool, labelAlign: PropTypes.oneOf(tuple('left', 'right')), - prop: { type: [String, Number, Array] as PropType }, - name: { type: [String, Number, Array] as PropType }, + prop: { type: [String, Number, Array] as PropType> }, + name: { type: [String, Number, Array] as PropType> }, rules: PropTypes.oneOfType([Array, Object]), autoLink: PropTypes.looseBool.def(true), required: PropTypes.looseBool, diff --git a/components/form/context.ts b/components/form/context.ts index 35edc91fb..ce4d0e25c 100644 --- a/components/form/context.ts +++ b/components/form/context.ts @@ -20,7 +20,7 @@ export interface FormContextProps { validateTrigger?: ComputedRef; rules?: ComputedRef<{ [k: string]: ValidationRule[] | ValidationRule }>; onValidate: ( - name: string | number | string[] | number[], + name: string | number | Array, status: boolean, errors: string[] | null, ) => void;