不生效的写法:
const theQuery = Object.assign( {},{
id: '',beginDate: '',endDate: '' // 查询条件
},_query.toJS() );
this.setState(theQuery);
action.getRefundList(theQuery)
可以生效的写法1:
const theQuery = Object.assign( {},{
id: '',beginDate: '',endDate: '' // 查询条件
},_query.toJS() );
this.setState(theQuery,() => { action.getRefundList(theQuery) } );
可以生效的写法2:
const theQuery = Object.assign( {},_query.toJS() );
this.setState(Object.assign( {},theQuery );
action.getRefundList(theQuery)
具体原因我却不太清楚,还望路过的大神们不吝赐教~