提交 05347da9 编写于 作者: A afc163

not emit fetch when there is no dataSource change, #347

上级 094ae9bb
......@@ -70,23 +70,25 @@ let AntTable = React.createClass({
},
componentWillReceiveProps(nextProps) {
let newState = {};
if (('pagination' in nextProps) && nextProps.pagination !== false) {
newState.pagination = objectAssign({}, this.state.pagination, nextProps.pagination);
this.setState({
pagination: objectAssign({}, this.state.pagination, nextProps.pagination)
});
}
// 外界只有 dataSource 的变化会触发新请求
if ('dataSource' in nextProps &&
nextProps.dataSource !== this.props.dataSource) {
newState = objectAssign(newState, {
this.setState({
selectedRowKeys: [],
dataSource: nextProps.dataSource,
loading: true
});
}, this.fetch);
}
if (nextProps.columns !== this.props.columns) {
newState.filters = {};
this.setState({
filters: {}
});
}
this.setState(newState, this.fetch);
},
hasPagination(pagination) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册