This commit is contained in:
nguyen van thai
2024-07-16 22:54:15 +07:00
parent 6f571d9549
commit 5f9525371d
6 changed files with 24 additions and 20 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import DynamicTemplate from "~/components/dynamic-page/page/templates/index.vue"
import DynamicSection from "~/components/dynamic-page/page-section/templates/index.vue";
const route = useRoute();
const site = useCookie("site")
const store = reactive({
dynamicPage: useDynamicPageStore(),
article: useArticleStore(),
@@ -20,7 +20,7 @@ import { useArticleStore } from '~/stores/articles';
const loadPage = async () => {
const article = await store.article.getArticleBySlug(String(route.params.slug));
console.log(article?.value, 'article')
site.value = article?.value.siteId
let isContentType
switch (article?.value?.contentType) {
case 1:
+2 -2
View File
@@ -11,12 +11,12 @@ const store = reactive({
});
//lấy danh sách categoryTree
await store.category.fetchBySiteId()
const site = useCookie('site')
const { data } = await useAsyncData('index', () => store.dynamicPage.fetchPageByCode(route.path === '/' ? 'trang-chu' : route.path.replace('/', '')))
const asycnCurrentPage = data.value && data.value.currentPage;
const asycnSectionPublished = data.value && data.value.sectionPublished;
const asycnComponentPublished = data.value && data.value.componentPublished;
site.value = data.value?.currentPage?.siteId
useHead({
title: () => 'Trang chủ',
description: () => 'Với công nghệ đột phá và giải pháp sáng tạo, Vpress sẽ là đối tác tin cậy của các tòa soạn báo, cùng nhau kiến tạo nên những giá trị bền vững trong kỷ nguyên chuyển đổi số báo chí.',