mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
update form documentation
This commit is contained in:
parent
5043a165f5
commit
e1d73eb424
@ -95,7 +95,7 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless
|
||||
| options.trigger | When to collect the value of children node | string | 'onChange' |
|
||||
| options.getValueFromEvent | To convert parameters of onChange to the value of control, for example, set value of DatePicker: `(date, dateString) => dateString` | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) |
|
||||
| options.validateTrigger | When to validate the value of children node. | string | 'onChange' |
|
||||
| options.rules | Includes validation rules. Please refer to [async-validator](https://github.com/yiminghe/async-validator) for details. | array | n/a |
|
||||
| options.rules | Includes validation rules. Please refer to [async-validator](https://github.com/yiminghe/async-validator#rules) for details. | array | n/a |
|
||||
| options.exclusive | Whether it is exclusive with other controls, particularly for Radio. | boolean | false |
|
||||
|
||||
### Form.Item
|
||||
@ -106,12 +106,12 @@ Note:
|
||||
|
||||
| Property | Description | Type | Default Value |
|
||||
|---------------|--------------------------------------|--------|---------------|
|
||||
| label | Label text | string | |
|
||||
| label | Label text | React.Node | |
|
||||
| labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` same as with `<Col>` | object | |
|
||||
| wrapperCol | The layout for input controls. Same as `labelCol` | object | |
|
||||
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | string | |
|
||||
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time. | string | |
|
||||
| required | Whether provided or not, it will be generated by the validation rule. | boolean | false |
|
||||
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | React.Node | |
|
||||
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time. | React.Node | |
|
||||
| required | Whether provided or not, it will be generated by the validation rule. | boolean | false |
|
||||
| validateStatus | The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' | string | |
|
||||
| hasFeedback | Used with `validateStatus`, this option specifies the validation status icon. Recommended to be used only with `Input`. | boolean | false |
|
||||
|
||||
|
@ -97,7 +97,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
| options.trigger | 收集子节点的值的时机 | string | 'onChange' |
|
||||
| options.getValueFromEvent | 可以把 onChange 的参数转化为控件的值,例如 DatePicker 可设为:`(date, dateString) => dateString` | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) |
|
||||
| options.validateTrigger | 校验子节点值的时机 | string | 'onChange' |
|
||||
| options.rules | 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator) | array | |
|
||||
| options.rules | 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator#rules) | array | |
|
||||
| options.exclusive | 是否和其他控件互斥,特别用于 Radio 单选控件 | boolean | false |
|
||||
|
||||
### Form.Item
|
||||
@ -108,11 +108,11 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|-----------|--------|
|
||||
| label | label 标签的文本 | string | |
|
||||
| label | label 标签的文本 | React.Node | |
|
||||
| labelCol | label 标签布局,通 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` | object | |
|
||||
| wrapperCol | 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol | object | |
|
||||
| help | 提示信息,如不设置,则会根据校验规则自动生成 | string | |
|
||||
| extra | 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | string | |
|
||||
| help | 提示信息,如不设置,则会根据校验规则自动生成 | React.Node | |
|
||||
| extra | 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | React.Node | |
|
||||
| required | 是否必填,如不设置,则会根据校验规则自动生成 | boolean | false |
|
||||
| validateStatus | 校验状态,如不设置,则会根据校验规则自动生成,可选:'success' 'warning' 'error' 'validating' | string | |
|
||||
| hasFeedback | 配合 validateStatus 属性使用,展示校验状态图标,建议只配合 Input 组件使用 | boolean | false |
|
||||
|
Loading…
Reference in New Issue
Block a user