李勇
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/components/Table/src/hooks/useDataSource.ts
|
|
@ -310,7 +310,7 @@ export function useDataSource( |
|
|
const resultTotal: number = isArrayResult ? res.length : get(res, totalField); |
|
|
const resultTotal: number = isArrayResult ? res.length : get(res, totalField); |
|
|
|
|
|
|
|
|
// 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行
|
|
|
// 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行
|
|
|
if (resultTotal) { |
|
|
if (Number(resultTotal)) { |
|
|
const currentTotalPage = Math.ceil(resultTotal / pageSize); |
|
|
const currentTotalPage = Math.ceil(resultTotal / pageSize); |
|
|
if (current > currentTotalPage) { |
|
|
if (current > currentTotalPage) { |
|
|
setPagination({ |
|
|
setPagination({ |
|
|
|