fix loading problem with nuxt content

Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
nurRiyad
2022-12-23 01:52:01 +06:00
parent 4508c10b33
commit f5021ebe06
2 changed files with 20 additions and 5 deletions

View File

@@ -1,13 +1,31 @@
<script setup lang="ts">
import { ParsedContent } from "@nuxt/content/dist/runtime/types";
definePageMeta({
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>
<template>
<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>
</template>

View File

@@ -25,9 +25,6 @@ const getRecentContent = computed(() => {
dir: post._dir,
};
});
console.log(modifedPost);
const filteredPost = modifedPost.filter(
(post) => post.dir === routeType.value
);