thainv-dev: fix

This commit is contained in:
nguyen van thai
2024-05-31 15:31:05 +07:00
parent 892bddde2f
commit c5887d911f
12 changed files with 143 additions and 59 deletions
+19 -5
View File
@@ -23,7 +23,7 @@ const store = reactive({
(async () => {
try {
store.article.getArticleBySlug(route.params.slug);
await store.article.getArticleBySlug(route.params.slug);
} catch (error) {
console.error("Error fetching data:", error);
}
@@ -37,21 +37,35 @@ const loadPage = async (contentType: string | number) => {
watch(currentArticle, async () => {
let isContentType : string = '';
console.log(currentArticle.value)
console.log(currentArticle.value.contentType, 'type')
switch (currentArticle.value?.contentType) {
case 1:
isContentType = 'trang-chi-tiet-emagazine'
isContentType = 'trang-doi-song'
break;
case 2:
isContentType = 'ArticleLayoutImage'
break;
case 3:
isContentType = 'ArticleLayoutPodcast'
break;
case 4:
isContentType = 'ArticleLayoutVideo'
break;
case 5:
if (currentArticle.value?.layoutType === 3) isContentType = 'trang-chi-tiet-emagazine'
else isContentType = 'trang-chi-tiet-emagazine'
if (currentArticle.value?.layoutType === 3) {
isContentType = 'trang-chi-tiet-emagazine'
break;
}
else {
isContentType = 'trang-chi-tiet-emagazine'
break;
}
default:
isContentType = 'trang-chi-tiet-emagazine'
break;
}
await loadPage(isContentType)
}, { deep: true })