From b36e96043f793f226f34a17bedb240612646c5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Sun, 2 Feb 2020 21:40:16 +0800 Subject: [PATCH] feat: Form.Item support validateFirst (#21178) --- components/form/index.en-US.md | 1 + components/form/index.zh-CN.md | 1 + package.json | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 7d1a4ed6d6..ce9b66b22f 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -85,6 +85,7 @@ Form field component for data bidirectional binding, validation, layout, and so | rules | Rules for field validation. Click [here](#components-form-demo-basic) to see an example | [Rule](#Rule)[] | - | | shouldUpdate | Custom field update logic. See [bellow](#shouldUpdate) | boolean \| (prevValue, curValue) => boolean | false | | trigger | When to collect the value of children node | string | onChange | +| validateFirst | Whether stop validate on first rule of error for this field | boolean | false | | validateStatus | The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' | string | - | | validateTrigger | When to validate the value of children node | string \| string[] | onChange | | valuePropName | Props of children node, for example, the prop of Switch is 'checked' | string | 'value' | diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 14593e633f..22841b7e08 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -86,6 +86,7 @@ const validateMessages = { | rules | 校验规则,设置字段的校验逻辑。点击[此处](#components-form-demo-basic)查看示例 | [Rule](#Rule)[] | - | | shouldUpdate | 自定义字段更新逻辑,说明[见下](#shouldUpdate) | boolean \| (prevValue, curValue) => boolean | false | | trigger | 设置收集字段值变更的时机 | string | onChange | +| validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false | | validateStatus | 校验状态,如不设置,则会根据校验规则自动生成,可选:'success' 'warning' 'error' 'validating' | string | - | | validateTrigger | 设置字段校验的时机 | string \| string[] | onChange | | valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' | diff --git a/package.json b/package.json index d9884f5762..c72398073b 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "rc-dialog": "~7.6.0", "rc-drawer": "~3.1.1", "rc-dropdown": "~3.0.0-alpha.0", - "rc-field-form": "^0.0.0-rc.0", + "rc-field-form": "^0.0.0-rc.1", "rc-input-number": "~4.5.0", "rc-mentions": "~1.0.0-alpha.3", "rc-menu": "~8.0.0-alpha.7",