23 lines
410 B
Vue
23 lines
410 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: {
|
||
|
tag: route.params.tag,
|
||
|
body: false,
|
||
|
render: false,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
onMounted(() => {
|
||
|
refresh();
|
||
|
});
|
||
|
</script>
|