fix loading problem with nuxt content
Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
@@ -1,13 +1,31 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ParsedContent } from "@nuxt/content/dist/runtime/types";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: "blog",
|
layout: "blog",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const path = computed(() => {
|
||||||
|
return route.path || "";
|
||||||
|
});
|
||||||
|
|
||||||
|
const { data } = await useAsyncData("page-data", () =>
|
||||||
|
queryContent(`${path.value}`).findOne()
|
||||||
|
);
|
||||||
|
|
||||||
|
const content = computed(() => {
|
||||||
|
return data.value as ParsedContent;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main
|
<main
|
||||||
class="container mx-auto bg-white max-w-5xl p-6 min-h-screen prose prose-slate"
|
class="container mx-auto bg-white max-w-6xl p-6 min-h-screen prose prose-slate"
|
||||||
>
|
>
|
||||||
<ContentDoc />
|
<ContentRenderer :value="content">
|
||||||
|
<ContentRendererMarkdown :value="content" />
|
||||||
|
</ContentRenderer>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ const getRecentContent = computed(() => {
|
|||||||
dir: post._dir,
|
dir: post._dir,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(modifedPost);
|
|
||||||
|
|
||||||
const filteredPost = modifedPost.filter(
|
const filteredPost = modifedPost.filter(
|
||||||
(post) => post.dir === routeType.value
|
(post) => post.dir === routeType.value
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user