提交 879eae82 authored 作者: chlolch's avatar chlolch

修改bug

上级 f96eab9d
...@@ -16,7 +16,7 @@ export default class ChildForm extends React.Component { ...@@ -16,7 +16,7 @@ export default class ChildForm extends React.Component {
// Should provide an event to pass value to Form. // Should provide an event to pass value to Form.
const onChange = this.props.onChange; const onChange = this.props.onChange;
if (onChange) { if (onChange) {
onChange(Object.assign({}, this.state, changedValue)); onChange(changedValue);
} }
}; };
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
...@@ -24,8 +24,7 @@ export default class ChildForm extends React.Component { ...@@ -24,8 +24,7 @@ export default class ChildForm extends React.Component {
if ('value' in nextProps) { if ('value' in nextProps) {
const value = nextProps.value; const value = nextProps.value;
this.state = value;
this.setState(value)
} }
} }
componentDidMount = () => { componentDidMount = () => {
...@@ -64,10 +63,12 @@ export default class ChildForm extends React.Component { ...@@ -64,10 +63,12 @@ export default class ChildForm extends React.Component {
const x = form.getFieldValue(base52); const x = form.getFieldValue(base52);
delete x[uuid]; delete x[uuid];
delete x[""]; delete x[""];
if (!('value' in this.props)) { if (!('value' in this.props)) {
this.setState(x); this.state=x
} }
this.triggerChange(x); this.triggerChange(x);
...@@ -100,7 +101,6 @@ export default class ChildForm extends React.Component { ...@@ -100,7 +101,6 @@ export default class ChildForm extends React.Component {
render() { render() {
const objs = this.state; const objs = this.state;
const { const {
form, form,
mapData, mapData,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论