mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
fix pagination change bug in Table
This commit is contained in:
parent
a69b7b70a1
commit
9961605c5a
@ -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…
Reference in New Issue
Block a user