mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
update Table initial current page
This commit is contained in:
parent
6e00ea8945
commit
4835471210
@ -21,7 +21,6 @@ const defaultLocale = {
|
||||
|
||||
const defaultPagination = {
|
||||
pageSize: 10,
|
||||
current: 1,
|
||||
onChange: noop,
|
||||
onShowSizeChange: noop,
|
||||
};
|
||||
@ -61,16 +60,19 @@ export default class Table extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const pagination = props.pagination || {};
|
||||
|
||||
this.state = {
|
||||
// 减少状态
|
||||
selectedRowKeys: this.props.selectedRowKeys || [],
|
||||
selectedRowKeys: props.selectedRowKeys || [],
|
||||
filters: this.getFiltersFromColumns(),
|
||||
selectionDirty: false,
|
||||
...this.getSortStateFromColumns(),
|
||||
pagination: this.hasPagination() ?
|
||||
{
|
||||
...defaultPagination,
|
||||
...this.props.pagination,
|
||||
...pagination,
|
||||
current: pagination.defaultCurrent || pagination.current || 1,
|
||||
} : {},
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user