parent
a96b386e8d
commit
da4d4a5d1c
@ -0,0 +1,5 @@ |
||||
export default { |
||||
path: "/p/:slug", |
||||
name: "PublicPage", |
||||
component: () => import("../views/page/PagePublic.vue"), |
||||
} |
@ -0,0 +1,38 @@ |
||||
<script setup> |
||||
import { ref } from "vue" |
||||
import { useRoute } from "vue-router" |
||||
import { useI18n } from "vue-i18n" |
||||
import SectionHeader from "../../components/layout/SectionHeader.vue" |
||||
import pageService from "../../services/pageService" |
||||
import { useNotification } from "../../composables/notification" |
||||
import Loading from "../../components/Loading.vue" |
||||
|
||||
const route = useRoute() |
||||
const { t } = useI18n() |
||||
const { showWarningNotification } = useNotification() |
||||
|
||||
const isLoading = ref(true) |
||||
const page = ref() |
||||
|
||||
pageService |
||||
.getBySlug(route.params.slug) |
||||
.then((result) => { |
||||
if (result) { |
||||
page.value = result |
||||
|
||||
return |
||||
} |
||||
|
||||
showWarningNotification(t("Not found")) |
||||
}) |
||||
.finally(() => (isLoading.value = false)) |
||||
</script> |
||||
|
||||
<template> |
||||
<div v-if="page"> |
||||
<SectionHeader :title="page.title" /> |
||||
|
||||
<div v-html="page.content"></div> |
||||
</div> |
||||
<Loading :visible="isLoading" /> |
||||
</template> |
Loading…
Reference in new issue