1
0
mirror of https://github.com/amir20/dozzle.git synced 2026-01-02 11:07:26 +01:00

fix: fixes changing items per page. fixes #2784 (#2786)

This commit is contained in:
Amir Raminfar
2024-02-19 15:12:16 -08:00
committed by GitHub
parent d2d573c399
commit 07d0c7fac5

View File

@@ -129,6 +129,7 @@ const sortedContainers = computedWithControl(
const totalPages = computed(() => Math.ceil(sortedContainers.value.length / perPage.value));
const isPaginated = computed(() => totalPages.value > 1);
const currentPage = ref(1);
watch(perPage, () => (currentPage.value = 1));
const paginated = computed(() => {
const start = (currentPage.value - 1) * perPage.value;
const end = start + perPage.value;