Skip to content

Commit

Permalink
fix(frontend): 改变分页limit页码未初始化问题修复 #7080
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves authored and jinquantianxia committed Sep 24, 2024
1 parent 80b451c commit e110e9a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ export default function (originalData: Ref<HostDetails[]>) {
const handlePaginationCurrentChange = (current: number) => {
pagination.current = current;
};

const handlePaginationLimitChange = (limit: number) => {
pagination.limit = limit;
pagination.current = 1;
};

watch(searchKey, () => {
pagination.current = 1;
});

watch(
serachList,
(list) => {
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/components/db-table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@
// 切换每页条数
const handlePageLimitChange = (pageLimit: number) => {
pagination.limit = pageLimit;
pagination.current = 1;
fetchListData();
};

Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/hooks/useLocalPagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export function useLocalPagination<T>(originalData: Ref<Array<T>>, callback: (ru
};
const handlePaginationLimitChange = (limit: number) => {
pagination.limit = limit;
handlePaginationCurrentChange(1);
};

watch(searchKey, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
const pageLimitChange = (pageLimit: number) => {
pagination.limit = pageLimit;
pagination.current = 1;
fetchData();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
// 切换每页条数
const handlePageLimitChange = (pageLimit: number) => {
pagination.limit = pageLimit;
pagination.current = 1;
fetchListData();
};

Expand Down

0 comments on commit e110e9a

Please sign in to comment.