From 4835471210b92d6f2755a4058c7c2c10187a7849 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 14 Apr 2016 14:47:39 +0800 Subject: [PATCH] update Table initial current page --- components/table/index.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 4d9648ecfc..7895c59369 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -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, } : {}, }; }