<script setup lang="ts">
const { data: posts } = await useAsyncData("blog", () =>
queryCollection("blog").all()
);
</script>
<template>
<div>
<h1>Blogs:</h1>
<ul>
<li v-for="post in posts" :key="post.id">
{{ post.path }}
<NuxtLink :to="post.path">{{ post.title }}</NuxtLink>
</li>
</ul>
</div>
</template>
<script setup lang="ts">
const { data: posts } = await useAsyncData("blog", () =>
queryCollection("blog").all()
);
</script>
<template>
<div>
<h1>Blogs:</h1>
<ul>
<li v-for="post in posts" :key="post.id">
{{ post.path }}
<NuxtLink :to="post.path">{{ post.title }}</NuxtLink>
</li>
</ul>
</div>
</template>