lepsi infinite scroll

This commit is contained in:
Michal Kváček
2026-01-06 22:02:24 +01:00
parent ea88a29750
commit 33e7aa6e36
22 changed files with 381 additions and 348 deletions
+4 -16
View File
@@ -17,21 +17,11 @@ useMeta(() => metaData({
title: "Místa"
}))
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination({
const {loadPage, paginationLimit, hasMoreData, handleFiltersChanged} = usePagination({
fetchFunction: usePointsOfInterestStore().fetchPublic
});
onMounted(() => {
loadPage(false);
});
const handleFiltersChanged = (newFilters) => {
paginationOffset.value = 0;
filters.value = newFilters;
loadPage(false);
}
const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
const {pointsOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
</script>
<template>
@@ -43,10 +33,8 @@ const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePoint
v-else
:public="true"
:items="pointsOfInterest"
:total-items-count="totalItemsCount"
:is-query-running="isQueryRunning"
:items-per-page="paginationLimit"
@load-more="loadPage(true)"
:has-more-data="hasMoreData"
@load-more="loadPage($event.index, $event.done)"
/>
</div>
</template>