mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
fix: form layout doc (#49206)
This commit is contained in:
parent
b683f18141
commit
e02f74233b
@ -91,7 +91,6 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| onFinishFailed | Trigger after submitting the form and verifying data failed | function({ values, errorFields, outOfDate }) | - | |
|
||||
| onValuesChange | Trigger when value updated | function(changedValues, allValues) | - | |
|
||||
| clearOnDestroy | Clear form values when the form is uninstalled | boolean | false | 5.18.0 |
|
||||
| layout | Form item layout | `horizontal` \| `vertical` | - | 5.18.0 |
|
||||
|
||||
### validateMessages
|
||||
|
||||
@ -154,6 +153,7 @@ Form field component for data bidirectional binding, validation, layout, and so
|
||||
| validateTrigger | When to validate the value of children node | string \| string\[] | `onChange` | |
|
||||
| valuePropName | Props of children node, for example, the prop of Switch or Checkbox is `checked`. This prop is an encapsulation of `getValueProps`, which will be invalid after customizing `getValueProps` | string | `value` | |
|
||||
| wrapperCol | The layout for input controls, same as `labelCol`. You can set `wrapperCol` on Form which will not affect nest Item. If both exists, use Item first | [object](/components/grid/#col) | - | |
|
||||
| layout | Form item layout | `horizontal` \| `vertical` | - | 5.18.0 |
|
||||
|
||||
After wrapped by `Form.Item` with `name` property, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controls, the flow of form data will be handled by Form which will cause:
|
||||
|
||||
|
@ -92,7 +92,6 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*ylFATY6w-ygAAA
|
||||
| onFinishFailed | 提交表单且数据验证失败后回调事件 | function({ values, errorFields, outOfDate }) | - | |
|
||||
| onValuesChange | 字段值更新时触发回调事件 | function(changedValues, allValues) | - | |
|
||||
| clearOnDestroy | 当表单被卸载时清空表单值 | boolean | false | 5.18.0 |
|
||||
| layout | 表单项布局 | `horizontal` \| `vertical` \| | - | 5.18.0 |
|
||||
|
||||
### validateMessages
|
||||
|
||||
@ -155,6 +154,7 @@ const validateMessages = {
|
||||
| validateTrigger | 设置字段校验的时机 | string \| string\[] | `onChange` | |
|
||||
| valuePropName | 子节点的值的属性。注意:Switch、Checkbox 的 valuePropName 应该是是 `checked`,否则无法获取这个两个组件的值。该属性为 `getValueProps` 的封装,自定义 `getValueProps` 后会失效 | string | `value` | |
|
||||
| wrapperCol | 需要为输入控件设置布局样式时,使用该属性,用法同 `labelCol`。你可以通过 Form 的 `wrapperCol` 进行统一设置,不会作用于嵌套 Item。当和 Form 同时设置时,以 Item 为准 | [object](/components/grid-cn#col) | - | |
|
||||
| layout | 表单项布局 | `horizontal` \| `vertical` \| | - | 5.18.0 |
|
||||
|
||||
被设置了 `name` 属性的 `Form.Item` 包装的控件,表单控件会自动添加 `value`(或 `valuePropName` 指定的其他属性) `onChange`(或 `trigger` 指定的其他属性),数据同步将被 Form 接管,这会导致以下结果:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user