lunasqu.ee-nuxt/pages/blog/archive/[year]/[month]/[day]/index.vue
2022-10-16 14:04:03 +03:00

25 lines
470 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, refresh } = await useFetch<BlogPost[]>(`/api/blog`, {
params: {
year: route.params.year,
month: route.params.month,
day: route.params.day,
body: false,
render: false,
},
});
onMounted(() => {
refresh();
});
</script>