Skip to content

Commit

Permalink
fix: does not affect submit
Browse files Browse the repository at this point in the history
  • Loading branch information
hchlq committed Apr 27, 2023
1 parent 941a196 commit 1b51183
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/hooks/src/useAntdTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ const useAntdTable = <TData extends Data, TParams extends Params>(
validateFields()
.then((values = {}) => {
const pagination = initPagination || {
pageSize: options.defaultPageSize || 10,
...(params?.[0] || {}),
pageSize: options.defaultPageSize || options.defaultParams?.[0]?.pageSize || 10,
current: 1,
};
if (!form) {
Expand Down Expand Up @@ -155,7 +155,11 @@ const useAntdTable = <TData extends Data, TParams extends Params>(
if (form) {
form.resetFields();
}
_submit();
_submit({
...(defaultParams?.[0] || {}),
pageSize: options.defaultPageSize || options.defaultParams?.[0]?.pageSize || 10,
current: 1,
});
};

const submit = (e?: any) => {
Expand Down

0 comments on commit 1b51183

Please sign in to comment.