remove onChange functions in Table.onChange(pagination)

This commit is contained in:
afc163 2017-02-19 13:55:36 +08:00
parent b34557ef17
commit 6e4fae0e29
2 changed files with 5 additions and 4 deletions

View File

@ -731,9 +731,12 @@ export default class Table<T> extends React.Component<TableProps<T>, any> {
/> : null;
}
// Get pagination, filters, sorter
prepareParamsArguments(state: any): [any, string[], Object] {
// 准备筛选、排序、分页的参数
const pagination = state.pagination;
const pagination = { ...state.pagination };
// remove useless handle function in Table.onChange
delete pagination.onChange;
delete pagination.onShowSizeChange;
const filters = state.filters;
const sorter: any = {};
if (state.sortColumn && state.sortOrder) {

View File

@ -68,8 +68,6 @@ describe('Table.pagination', () => {
expect(handleChange).toBeCalledWith(
{
current: 2,
onChange: handlePaginationChange,
onShowSizeChange: noop,
pageSize: 2,
},
{},