Breadcrumbs resit pres funkce
This commit is contained in:
@@ -20,6 +20,8 @@ import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import EventBasicInfo from "components/event/EventBasicInfo.vue";
|
||||
import EventFlightsMap from "components/event/EventFlightsMap.vue";
|
||||
import {publicEventBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -31,23 +33,18 @@ const props = defineProps({
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
useAppStore().setPageTitle(event.value.name);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
||||
{to: {name: "publicEventsList", params: {username: props.pilot.publicUsername}}, label: "Události"},
|
||||
{label: event.value.name}
|
||||
]);
|
||||
useAppStore().setBreadcrumbs(publicEventBreadcrumbs(props.pilot, event.value, false));
|
||||
useMeta(() => metaData({
|
||||
title: event.value.name,
|
||||
description: event.value.description
|
||||
}))
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {username: props.pilot.publicUsername, eventId: event.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic, appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
|
||||
onMounted(() => {
|
||||
loadPage(false);
|
||||
})
|
||||
|
||||
const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
@@ -80,7 +77,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user