TOPVERSE_Official/pages/blog/[id].vue

31 lines
751 B
Vue
Raw Normal View History

2023-05-05 17:23:07 +08:00
<script setup>
const route = useRoute()
const { locale } = useI18n()
2023-05-16 21:18:46 +08:00
const path = `/${locale.value}/${route.params.id}`
2023-05-05 17:23:07 +08:00
const { data } = await useAsyncData(`content-${path}`, () => {
return queryContent().where({ _path: path }).findOne()
})
2023-05-25 18:00:00 +08:00
console.log(data)
2023-05-05 17:23:07 +08:00
</script>
<template>
2023-05-16 21:18:46 +08:00
<SectionBanner :img="data?.img" :title="data?.title" :topic="data?.topic" :description="data?.description" font-bold text-white />
<main class="m-auto prose xl:max-w-900px">
2023-05-05 17:23:07 +08:00
<ContentRenderer v-if="data" :value="data" />
</main>
2023-05-25 18:00:00 +08:00
<div class="m-auto mb-20 text-right prose xl:max-w-900px">
<span>
{{ data?.author }}
</span>
<span>
{{ data?.resume }}
</span>
<span>
{{ data?.publish }}
</span>
</div>
2023-05-05 17:23:07 +08:00
</template>