change: full path urls
This commit is contained in:
parent
7a300d93b6
commit
20be3f560c
2 changed files with 7 additions and 6 deletions
|
@ -54,7 +54,7 @@
|
|||
v-for="sublink in navbar_sub_items"
|
||||
:key="sublink.id"
|
||||
:to="`/${params?.[0]}/${sublink.URL}`"
|
||||
:class="sublink.URL == params?.[1] && !params[2] ? 'active' : ''"
|
||||
:class="sublink.URL == params?.[1] ? 'active' : ''"
|
||||
class="w-fit"
|
||||
>
|
||||
{{ sublink.name }}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<template>
|
||||
{{ collectionDetail }}
|
||||
<NuxtLayout name="default">
|
||||
<NotFound v-if="notFound" />
|
||||
<ContentBuilder v-else-if="showContentBuilder" :hero="page?.hero" :content="page?.content" />
|
||||
|
@ -48,7 +49,7 @@ const { data: pages } = await useAsyncData("pages", () =>
|
|||
},
|
||||
},
|
||||
filters: {
|
||||
...(active_page_id.value == "" ? { slug: params[0], ref_only_access: false } : {}),
|
||||
...(active_page_id.value == "" ? { slug: params.join("_"), ref_only_access: false } : {}),
|
||||
},
|
||||
})
|
||||
);
|
||||
|
@ -57,11 +58,11 @@ const page = computed(() => {
|
|||
});
|
||||
|
||||
let detail = ref<Article | Operation | Event | Vehicle | undefined>(undefined);
|
||||
const searchDetail = computed(() => {
|
||||
const collectionDetail = computed(() => {
|
||||
if (!active_sub_item.value) return params[1];
|
||||
return params[2];
|
||||
});
|
||||
if (searchDetail.value) {
|
||||
if (collectionDetail.value) {
|
||||
let collectionOfDetail = [
|
||||
...new Set(
|
||||
page.value?.content
|
||||
|
@ -88,12 +89,12 @@ if (searchDetail.value) {
|
|||
}
|
||||
|
||||
const notFound = computed(() => {
|
||||
if (searchDetail.value) return !detail.value;
|
||||
if (collectionDetail.value && detail.value) return !detail.value;
|
||||
else return active_page_id.value == "" && !page.value?.content && !page.value?.hero;
|
||||
});
|
||||
|
||||
const showContentBuilder = computed(() => {
|
||||
if (searchDetail.value) return !detail.value;
|
||||
if (collectionDetail.value && detail.value) return !detail.value;
|
||||
else return !!page.value?.content || !!page.value?.hero;
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue