fix:fetch-success total 0 (#1597)

Co-authored-by: qiuxiang <liumeiwang@localhost.com>
This commit is contained in:
lqxlearn 2022-01-18 21:48:05 +08:00 committed by GitHub
parent e82bafa43e
commit 929141be96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,7 @@ export function useDataSource(
const isArrayResult = Array.isArray(res);
let resultItems: Recordable[] = isArrayResult ? res : get(res, listField);
const resultTotal: number = isArrayResult ? 0 : get(res, totalField);
const resultTotal: number = isArrayResult ? res.length : get(res, totalField);
// 假如数据变少导致总页数变少并小于当前选中页码通过getPaginationRef获取到的页码是不正确的需获取正确的页码再次执行
if (resultTotal) {