Improve form demo

This commit is contained in:
ztplz 2018-11-23 12:35:12 +08:00 committed by 偏右
parent e0298dcc13
commit 2fa90b17d0

View File

@ -39,9 +39,8 @@ class DynamicFieldSet extends React.Component {
add = () => {
const { form } = this.props;
// can use data-binding to get
const myId = id++;
const keys = form.getFieldValue('keys');
const nextKeys = keys.concat(myId);
const nextKeys = keys.concat(++id);
// can use data-binding to set
// important! notify form to detect changes
form.setFieldsValue({