Skip to content

Commit

Permalink
HeaderNav.vueをコンポーネント方式に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
ics-konno committed Nov 13, 2024
1 parent 9e2fd64 commit 61ec3fb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions components/HeaderNav.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<script setup lang="ts">
const { data: navigation } = await useAsyncData("navigation", () =>
fetchContentNavigation(),
);
</script>
<script setup lang="ts"></script>

<template>
<ul>
<li v-for="link of navigation" :key="link._path">
<NuxtLink :to="link._path" class="link">{{ link.title }}</NuxtLink>
</li>
</ul>
<ContentNavigation>
<template #default="{ navigation }">
<ul>
<li v-for="link of navigation" :key="link._path">
<NuxtLink :to="link._path" class="link">{{ link.title }}</NuxtLink>
</li>
</ul>
</template>
<template #empty />
</ContentNavigation>
</template>

<style scoped>
Expand Down

0 comments on commit 61ec3fb

Please sign in to comment.