docs: add missing docs for array rule (#28437)

* docs: add missing docs for array rule

* update docs

* update docs
This commit is contained in:
zj9495 2021-02-04 22:04:34 +08:00 committed by GitHub
parent e5c4092509
commit f77a9ac402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -316,6 +316,8 @@ type Rule = RuleConfig | ((form: FormInstance) => RuleConfig);
| validateTrigger | Set validate trigger event. Must be the sub set of `validateTrigger` in Form.Item | string \| string\[] |
| validator | Customize validation rule. Accept Promise as return. See [example](#components-form-demo-register) | ([rule](#Rule), value) => Promise |
| whitespace | Failed if only has whitespace | boolean |
| defaultField | Validate rule for all array elements, valid when `type` is `array` | [rule](#Rule) |
| fields | Validate rule for child elements, valid when `type` is `array` or `object` | Record<string, [rule](#Rule)> |
## Migrate to v4

View File

@ -315,6 +315,8 @@ type Rule = RuleConfig | ((form: FormInstance) => RuleConfig);
| validateTrigger | 设置触发验证时机,必须是 Form.Item 的 `validateTrigger` 的子集 | string \| string\[] |
| validator | 自定义校验,接收 Promise 作为返回值。[示例](#components-form-demo-register)参考 | ([rule](#Rule), value) => Promise |
| whitespace | 如果字段仅包含空格则校验不通过 | boolean |
| defaultField | 仅在 `type``array` 类型时有效,用于指定数组元素的校验规则 | [rule](#Rule) |
| fields | 仅在 `type``array``object` 类型时有效,用于指定子元素的校验规则 | Record<string, [rule](#Rule)> |
## 从 v3 升级到 v4