Browse Source

fix: formItem name type #4998

close #4998
pull/5026/head
tangjinzhou 3 years ago
parent
commit
0a404e88b7
  1. 4
      components/form/FormItem.tsx
  2. 2
      components/form/context.ts

4
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<string | number | string[] | number[]> },
name: { 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 | Array<string | number>> },
rules: PropTypes.oneOfType([Array, Object]),
autoLink: PropTypes.looseBool.def(true),
required: PropTypes.looseBool,

2
components/form/context.ts

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

Loading…
Cancel
Save