minhnt-dev: design

This commit is contained in:
MoreStrive
2024-05-31 13:49:36 +07:00
parent 709a2c3232
commit 7b01ce6170
4 changed files with 17 additions and 7 deletions
+10 -1
View File
@@ -10,9 +10,18 @@ export const useArticleStore = defineStore("article", () => {
} catch (error: any) {}
}
const getArticleByCode = async (slug: string) => {
try {
const { data} = await useFetch(`/api/articles/get-by-slug/${slug}`)
currentArticle.value = {}
currentArticle.value = data.value.item
} catch (error: any) {}
}
return {
currentArticle,
getArticleById
getArticleById,
getArticleByCode
}
});