update Table initial current page

This commit is contained in:
afc163 2016-04-14 14:47:39 +08:00
parent 6e00ea8945
commit 4835471210

View File

@ -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,
} : {},
};
}