Browse Source

fix pagination change bug in Table

pull/2016/head
afc163 9 years ago
parent
commit
9961605c5a
  1. 12
      components/table/index.jsx

12
components/table/index.jsx

@ -101,9 +101,15 @@ export default class Table extends React.Component {
componentWillReceiveProps(nextProps) {
if (('pagination' in nextProps) && nextProps.pagination !== false) {
this.setState(previousState => ({
pagination: { ...defaultPagination, ...previousState.pagination, ...nextProps.pagination },
}));
this.setState(previousState => {
const newPagination = {
...defaultPagination,
...previousState.pagination,
...nextProps.pagination,
};
newPagination.current = newPagination.current || 1;
return { pagination: newPagination };
});
}
// dataSource
if ('dataSource' in nextProps &&

Loading…
Cancel
Save