fix: table-datasource,如果后端返回的page total是字符串,会导致页码乱掉 (#2483)

This commit is contained in:
李勇 2023-01-03 20:13:26 +08:00 committed by GitHub
parent 31042de6bc
commit 9090cee184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -310,7 +310,7 @@ export function useDataSource(
const resultTotal: number = isArrayResult ? res.length : get(res, totalField);
// 假如数据变少导致总页数变少并小于当前选中页码通过getPaginationRef获取到的页码是不正确的需获取正确的页码再次执行
if (resultTotal) {
if (Number(resultTotal)) {
const currentTotalPage = Math.ceil(resultTotal / pageSize);
if (current > currentTotalPage) {
setPagination({