@@ -11,12 +11,11 @@ const path = computed(() => {
|
|||||||
return route.path || "";
|
return route.path || "";
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data } = await useAsyncData("page-data", () =>
|
const data = useState("blogData");
|
||||||
queryContent(`${path.value}`).findOne()
|
|
||||||
);
|
|
||||||
|
|
||||||
const content = computed(() => {
|
const content = computed(() => {
|
||||||
return data.value as ParsedContent;
|
const allpost = (data.value as Array<ParsedContent>) || [];
|
||||||
|
return allpost.find((post) => post._path === path.value) || {};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ const getTopCategory = computed(() => {
|
|||||||
dir: post._dir,
|
dir: post._dir,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const uniqType = new Set(alltypes);
|
return [...new Map(alltypes.map((item) => [item["dir"], item])).values()];
|
||||||
return uniqType;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// get all post in recent time order
|
// get all post in recent time order
|
||||||
|
|||||||
Reference in New Issue
Block a user