diff --git a/components/form/demo/validate-only.md b/components/form/demo/validate-only.md new file mode 100644 index 0000000000..4a904d241a --- /dev/null +++ b/components/form/demo/validate-only.md @@ -0,0 +1,7 @@ +## zh-CN + +通过 `validateFields` 的 `validateOnly` 可以动态调整提交按钮的 `disabled` 状态。 + +## en-US + +Dynamic adjust submit button's `disabled` status by `validateOnly` of `validateFields`. diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 6c6f3d6487..13a92c9c75 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -249,7 +249,7 @@ Provide linkage between forms. If a sub form with `name` prop update, it will au | setFieldValue | Set fields value(Will directly pass to form store. If you do not want to modify passed object, please clone first) | (name: [NamePath](#NamePath), value: any) => void | 4.22.0 | | setFieldsValue | Set fields value(Will directly pass to form store. If you do not want to modify passed object, please clone first). Use `setFieldValue` instead if you want to only config single value in Form.List | (values) => void | | | submit | Submit the form. It's same as click `submit` button | () => void | | -| validateFields | Validate fields | (nameList?: [NamePath](#NamePath)\[]) => Promise | | +| validateFields | Validate fields | (nameList?: [NamePath](#namepath)\[], { validateOnly?: boolean }) => Promise | `validateOnly`: 4.24.12 | #### validateFields return sample diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index dd26ca5c17..8783be2008 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -248,7 +248,7 @@ Form.List 渲染表单相关操作函数。 | setFieldValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入) | (name: [NamePath](#NamePath), value: any) => void | 4.22.0 | | setFieldsValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入)。如果你只想修改 Form.List 中单项值,请通过 `setFieldValue` 进行指定 | (values) => void | | | submit | 提交表单,与点击 `submit` 按钮效果相同 | () => void | | -| validateFields | 触发表单验证 | (nameList?: [NamePath](#NamePath)\[]) => Promise | | +| validateFields | 触发表单验证 | (nameList?: [NamePath](#namepath)\[], { validateOnly?: boolean }) => Promise | `validateOnly`: 4.24.12 | #### validateFields 返回示例