diff --git a/components/pagination/index.md b/components/pagination/index.md index b4c62886c1..b9acffad65 100644 --- a/components/pagination/index.md +++ b/components/pagination/index.md @@ -19,15 +19,16 @@ ``` -| 参数 | 说明 | 类型 | 默认值 | -|------------------|------------------------------------|----------|----------------| -| current | 当前页数 | Number | 无 | -| defaultCurrent | 默认的当前页数 | Number | 1 | -| total | 数据总数 | Number | 0 | -| pageSize | 每页条数 | Number | 10 | -| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop | -| showSizeChanger | 是否可以改变 pageSize | Bool | false | -| onShowSizeChange | pageSize 变化的回调 | Function | noop | -| showQuickJumper | 是否可以快速跳转至某页 | Bool | false | -| size | 当为「small」时,是小尺寸分页 | String | "" | -| simple | 当添加该属性时,显示为简单分页 | Object | 无 | +| 参数 | 说明 | 类型 | 默认值 | +|------------------|------------------------------------|---------------|--------------------------| +| current | 当前页数 | Number | 无 | +| defaultCurrent | 默认的当前页数 | Number | 1 | +| total | 数据总数 | Number | 0 | +| pageSize | 每页条数 | Number | 10 | +| onChange | 页码改变的回调,参数是改变后的页码 | Function | noop | +| showSizeChanger | 是否可以改变 pageSize | Bool | false | +| pageSizeOptions | 指定每页可以显示多少条 | Array | ['10', '20', '30', '40'] | +| onShowSizeChange | pageSize 变化的回调 | Function | noop | +| showQuickJumper | 是否可以快速跳转至某页 | Bool | false | +| size | 当为「small」时,是小尺寸分页 | String | "" | +| simple | 当添加该属性时,显示为简单分页 | Object | 无 | diff --git a/components/table/demo/paging.md b/components/table/demo/paging.md index 9e3917f53b..2459cae6d9 100644 --- a/components/table/demo/paging.md +++ b/components/table/demo/paging.md @@ -39,6 +39,9 @@ const pagination = { showSizeChanger: true, onShowSizeChange: function(current, pageSize) { console.log('Current: ', current, '; PageSize: ', pageSize); + }, + onChange: function(current) { + console.log('Current: ', current); } }; diff --git a/components/table/index.jsx b/components/table/index.jsx index c2c0e73049..b0ca7a8314 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -19,6 +19,13 @@ const defaultLocale = { emptyText: '暂无数据', }; +const defaultPagination = { + pageSize: 10, + current: 1, + onChange: noop, + onShowSizeChange: noop, +}; + let AntTable = React.createClass({ getInitialState() { return { @@ -30,10 +37,9 @@ let AntTable = React.createClass({ sortOrder: '', sorter: null, radioIndex: null, - pagination: this.hasPagination() ? objectAssign({ - pageSize: 10, - current: 1 - }, this.props.pagination) : {} + pagination: this.hasPagination() ? + objectAssign({}, defaultPagination, this.props.pagination) : + {}, }; }, @@ -253,6 +259,8 @@ let AntTable = React.createClass({ } else { pagination.current = pagination.current || 1; } + pagination.onChange(pagination.current); + const newState = { selectionDirty: false, pagination @@ -423,9 +431,7 @@ let AntTable = React.createClass({ handleShowSizeChange(current, pageSize) { const pagination = this.state.pagination; - if (pagination.onShowSizeChange) { - pagination.onShowSizeChange(current, pageSize); - } + pagination.onShowSizeChange(current, pageSize); let nextPagination = objectAssign(pagination, { pageSize: pageSize diff --git a/components/time-picker/index.jsx b/components/time-picker/index.jsx index 259773e6c5..750485201c 100644 --- a/components/time-picker/index.jsx +++ b/components/time-picker/index.jsx @@ -15,7 +15,6 @@ const AntTimePicker = React.createClass({ align: { offset: [0, -2], }, - open: false, disabled: false, disabledHours: undefined, disabledMinutes: undefined, diff --git a/style/components/timepicker/Picker.less b/style/components/timepicker/Picker.less index 25dbc5dcc9..a6c307a944 100644 --- a/style/components/timepicker/Picker.less +++ b/style/components/timepicker/Picker.less @@ -1,5 +1,5 @@ .@{timepicker-prefix-cls}-panel { - min-width: 168px; + max-width: 168px; z-index: 1070; position: absolute; diff --git a/style/core/base.less b/style/core/base.less index b678c43e88..8cb73a4fbd 100644 --- a/style/core/base.less +++ b/style/core/base.less @@ -70,7 +70,7 @@ a { } &[disabled] { - // color: @grey-200; + color: #ccc; cursor: not-allowed; pointer-events: none; }