From 090fb16c77a9db5b1609db97dbbee678152cfdfd Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Sat, 10 Sep 2016 10:05:26 +0800 Subject: [PATCH] docs: update the doc of Form, ref: #2985 --- components/form/index.en-US.md | 2 +- components/form/index.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 92513dea5f..e25d06f224 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -66,7 +66,7 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr |-----------|------------------------------------------|------------| | getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function([fieldNames: string[]]) | | getFieldValue | Get the value of a field. | Function(fieldName: string) | -| setFieldsValue | Set the value of a field. | Function(obj: object) | +| setFieldsValue | Set the value of a field.(Note: please don't use it in `componentWillReceiveProps`, otherwise, it will cause an endless loop, [more](https://github.com/ant-design/ant-design/issues/2985)) | Function(obj: object) | | setFields | Set the value and error of a field. | Function(obj: object) | | validateFields | Validate the specified fields and get theirs values and errors. | Function([fieldNames: string[]], [options: object], callback: Function(errors, values)) | | validateFieldsAndScroll | This function is similar to `validateFields`, but after validation, if the target field is not in visible area of form, form will be automatically scrolled to the target field area. | same as `validateFields` | diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 2432961cf9..5198771698 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -68,7 +68,7 @@ CustomizedForm = Form.create({})(CustomizedForm); |-----------|------------------------------------------|------------| | getFieldsValue | 获取一组输入控件的值,如不传入参数,则获取全部组件的值 | Function([fieldNames: string[]]) | | getFieldValue | 获取一个输入控件的值 | Function(fieldName: string) | -| setFieldsValue | 设置一组输入控件的值 | Function(obj: object) | +| setFieldsValue | 设置一组输入控件的值(注意:不要在 `componentWillReceiveProps` 内使用,否则会导致死循环,[更多](https://github.com/ant-design/ant-design/issues/2985)) | Function(obj: object) | | setFields | 设置一组输入控件的值与 Error | Function(obj: object) | | validateFields | 校验并获取一组输入域的值与 Error | Function([fieldNames: string[]], [options: object], callback: Function(errors, values)) | | validateFieldsAndScroll | 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 | 参考 `validateFields` |