mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix(table): 修复表格分页计算问题
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user