Skip to content

Commit

Permalink
fix(Table): 解决 remoteDataSource 插件不支持方法的问题, Fixes #114
Browse files Browse the repository at this point in the history
  • Loading branch information
xz8la8 committed Jul 13, 2021
1 parent 56f5234 commit 76d72ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/sula/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sula",
"version": "1.2.0-beta.65",
"version": "1.2.0-beta.66",
"module": "./es/index.js",
"main": "./es/index.js",
"types": "./es/index.d.ts",
Expand Down
9 changes: 6 additions & 3 deletions packages/sula/src/table/useTableContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import assign from 'lodash/assign';
import pick from 'lodash/pick';
import omit from 'lodash/omit';
import isUndefined from 'lodash/isUndefined';
import isFunction from 'lodash/isFunction';
import { TableControlProps, TableProps, Filters, Pagination, Sorter, TableInstance } from './Table';
import { PaginationConfig } from 'antd/lib/pagination';
import { assignWithDefined } from '../_util/common';
Expand Down Expand Up @@ -323,9 +324,11 @@ class ContextStore {

return triggerActionPlugin(
this.getCtx(),
assign({}, this.tableProps.remoteDataSource, {
params: assign({}, this.tableProps.remoteDataSource.params, params),
}),
isFunction(this.tableProps.remoteDataSource)
? this.tableProps.remoteDataSource
: assign({}, this.tableProps.remoteDataSource, {
params: assign({}, this.tableProps.remoteDataSource!.params, params),
}),
);
}
}
Expand Down

0 comments on commit 76d72ed

Please sign in to comment.