fix: formItem name type #4998

close #4998
pull/5026/head
tangjinzhou 2021-12-08 14:56:57 +08:00
parent ee3188a782
commit 0a404e88b7
2 changed files with 3 additions and 3 deletions

View File

@ -84,8 +84,8 @@ export const formItemProps = {
hasFeedback: PropTypes.looseBool.def(false), hasFeedback: PropTypes.looseBool.def(false),
colon: PropTypes.looseBool, colon: PropTypes.looseBool,
labelAlign: PropTypes.oneOf(tuple('left', 'right')), labelAlign: PropTypes.oneOf(tuple('left', 'right')),
prop: { type: [String, Number, Array] as PropType<string | number | string[] | number[]> }, prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
name: { type: [String, Number, Array] as PropType<string | number | string[] | number[]> }, name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
rules: PropTypes.oneOfType([Array, Object]), rules: PropTypes.oneOfType([Array, Object]),
autoLink: PropTypes.looseBool.def(true), autoLink: PropTypes.looseBool.def(true),
required: PropTypes.looseBool, required: PropTypes.looseBool,

View File

@ -20,7 +20,7 @@ export interface FormContextProps {
validateTrigger?: ComputedRef<string | string[]>; validateTrigger?: ComputedRef<string | string[]>;
rules?: ComputedRef<{ [k: string]: ValidationRule[] | ValidationRule }>; rules?: ComputedRef<{ [k: string]: ValidationRule[] | ValidationRule }>;
onValidate: ( onValidate: (
name: string | number | string[] | number[], name: string | number | Array<string | number>,
status: boolean, status: boolean,
errors: string[] | null, errors: string[] | null,
) => void; ) => void;