Merge pull request #17 from Chika99/fix/table

fix(table): 修复表格分页计算问题
This commit is contained in:
Ah jung
2021-08-02 09:06:43 +08:00
committed by GitHub
@@ -74,10 +74,9 @@ export function useDataSource(
// 如果数据异常,需获取正确的页码再次执行 // 如果数据异常,需获取正确的页码再次执行
if (resultTotal) { if (resultTotal) {
const currentTotalPage = Math.ceil(resultTotal / pageSize); if (page > resultTotal) {
if (page > currentTotalPage) {
setPagination({ setPagination({
[pageField]: currentTotalPage, [pageField]: resultTotal,
}); });
fetch(opt); fetch(opt);
} }