fix: Add type of initialValue prop to Form.List (#28153)

* fix: Add type of initialValue prop to Form.List

* Update index.zh-CN.md

* Update index.en-US.md
This commit is contained in:
Debiancc 2020-12-02 21:28:46 +08:00 committed by GitHub
parent 52ceeafa7e
commit ca5b47f674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ export interface FormListProps {
prefixCls?: string;
name: string | number | (string | number)[];
rules?: ValidatorRule[];
initialValue?: any[];
children: (
fields: FormListFieldData[],
operation: FormListOperation,

View File

@ -169,7 +169,7 @@ Provides array management for fields.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| children | Render function | (fields: Field\[], operation: { add, remove, move }, meta: { errors }) => React.ReactNode | - | |
| initialValue | Config sub default value. Form `initialValues` get higher priority when conflict | string | - | 4.9.0 |
| initialValue | Config sub default value. Form `initialValues` get higher priority when conflict | any[] | - | 4.9.0 |
| name | Field name, support array | [NamePath](#NamePath) | - | |
| rules | Validate rules, only support customize validator. Should work with [ErrorList](#Form.ErrorList) | { validator, message }\[] | - | 4.7.0 |

View File

@ -170,7 +170,7 @@ Form 通过增量更新方式,只更新被修改的字段相关组件以达到
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| children | 渲染函数 | (fields: Field\[], operation: { add, remove, move }, meta: { errors }) => React.ReactNode | - | |
| initialValue | 设置子元素默认值,如果与 Form 的 `initialValues` 冲突则以 Form 为准 | string | - | 4.9.0 |
| initialValue | 设置子元素默认值,如果与 Form 的 `initialValues` 冲突则以 Form 为准 | any[] | - | 4.9.0 |
| name | 字段名,支持数组 | [NamePath](#NamePath) | - | |
| rules | 校验规则,仅支持自定义规则。需要配合 [ErrorList](#Form.ErrorList) 一同使用。 | { validator, message }\[] | - | 4.7.0 |