Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): 改变分页limit页码未初始化问题修复 #7080 #7117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading