lepsi infinite scroll
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user