thainv-dev: fix ui
This commit is contained in:
+18
-1
@@ -1,5 +1,9 @@
|
||||
interface ArticleCondition {
|
||||
ids?: number[]
|
||||
}
|
||||
export const useArticleStore = defineStore("article", () => {
|
||||
const currentArticle = ref<any>({});
|
||||
const currentArticles = ref<any[]>([])
|
||||
|
||||
const getArticleById = async (id: string | number) => {
|
||||
try {
|
||||
@@ -18,10 +22,23 @@ export const useArticleStore = defineStore("article", () => {
|
||||
} catch (error: any) {}
|
||||
}
|
||||
|
||||
const getArticleCondition = async (condition: ArticleCondition) => {
|
||||
try {
|
||||
const { data: articles } = await useFetch(`/api/articles/condition`, {
|
||||
method: 'POST',
|
||||
body: condition
|
||||
})
|
||||
console.log(articles, 'data')
|
||||
} catch (error: any) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
currentArticle,
|
||||
getArticleById,
|
||||
getArticleBySlug
|
||||
getArticleBySlug,
|
||||
getArticleCondition
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user