feat: Seo meta tag

This commit is contained in:
MoreStrive
2024-06-03 10:24:28 +07:00
parent e126b2ab40
commit 94ea03f189
2 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -12,9 +12,9 @@ export const useArticleStore = defineStore("article", () => {
const getArticleBySlug = async (slug: string) => {
try {
const { data} = await useFetch(`/api/articles/get-by-slug/${slug}`)
const { data: article } = await useAsyncData('article', () => $fetch(`/api/articles/get-by-slug/${slug}`))
currentArticle.value = {}
currentArticle.value = data.value.item
currentArticle.value = article.value?.item
} catch (error: any) {}
}