21 lines
456 B
Vue
21 lines
456 B
Vue
<template>
|
|
<NuxtLayout name="blog">
|
|
<BlogArchive :posts="posts" />
|
|
</NuxtLayout>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { BlogPost } from '~~/lib/types/post';
|
|
|
|
const route = useRoute();
|
|
const { data: posts } = await useFetch<BlogPost[]>(`/api/blog`, {
|
|
key: `${route.params.year}-${route.params.month}-page`,
|
|
params: {
|
|
year: route.params.year,
|
|
month: route.params.month,
|
|
body: false,
|
|
render: false,
|
|
},
|
|
});
|
|
</script>
|