From e6554e7edb51297dd302b70e089d540cf57c1045 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 16 Jul 2017 15:05:48 +0800 Subject: [PATCH] update form document --- components/form/index.en-US.md | 5 ++++- components/form/index.zh-CN.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 6bc9597dbb..5daeeb56cd 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -103,10 +103,13 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless | options.valuePropName | Props of children node, for example, the prop of Switch is 'checked'. | string | 'value' | | options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internaly, we recommend to use vairable as `initialValue`, instead of literal) | | n/a | | options.trigger | When to collect the value of children node | string | 'onChange' | -| options.getValueFromEvent | To convert parameters of onChange to the value of control | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) | +| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) | | options.validateTrigger | When to validate the value of children node. | string\|string[] | 'onChange' | | options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object[] | n/a | | options.exclusive | Whether it is exclusive with other controls, particularly for Radio. | boolean | false | +| options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | + +More option at [rc-form option](https://github.com/react-component/form#option-object)。 ### Form.Item diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 05eec7a78d..297b29020a 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -104,10 +104,13 @@ CustomizedForm = Form.create({})(CustomizedForm); | options.valuePropName | 子节点的值的属性,如 Switch 的是 'checked' | string | 'value' | | options.initialValue | 子节点的初始值,类型、可选值均由子节点决定(注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量)) | | | | options.trigger | 收集子节点的值的时机 | string | 'onChange' | -| options.getValueFromEvent | 可以把 onChange 的参数转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#optiongetvaluefromevent) | +| options.getValueFromEvent | 可以把 onChange 的参数(如 event)转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) | | options.validateTrigger | 校验子节点值的时机 | string\|string[] | 'onChange' | | options.rules | 校验规则,参考下方文档 | object[] | | | options.exclusive | 是否和其他控件互斥,特别用于 Radio 单选控件 | boolean | false | +| options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | + +更多参数请查看 [rc-form option](https://github.com/react-component/form#option-object)。 ### Form.Item -- GitLab