Skip to content

Commit

Permalink
fix(table): 修复表格分页计算问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Chika99 committed Aug 1, 2021
1 parent 58f0997 commit 6a290b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Table/src/hooks/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ export function useDataSource(

// 如果数据异常,需获取正确的页码再次执行
if (resultTotal) {
const currentTotalPage = Math.ceil(resultTotal / pageSize);
if (page > currentTotalPage) {
if (page > resultTotal) {
setPagination({
[pageField]: currentTotalPage,
[pageField]: resultTotal,
});
fetch(opt);
}
Expand Down

0 comments on commit 6a290b3

Please sign in to comment.