Navigation.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <nav>
  3. <ul role="list">
  4. <li class="relative my-6">
  5. <h2 class="text-xs font-semibold text-white">
  6. {{ navigation[0].title }}
  7. </h2>
  8. <div class="relative mt-3 pl-2">
  9. <div class="absolute inset-y-0 left-2 w-px bg-white/5"></div>
  10. <ul role="list" class="border-l border-white/20">
  11. <li :class="{
  12. 'rounded-lg bg-white/5 -ml-4 pl-4': navigation[0]._path === route.path
  13. }">
  14. <NuxtLink
  15. :to="navigation[0]._path"
  16. class="flex justify-between gap-2 pr-3 text-sm transition"
  17. :class="{
  18. 'text-white': navigation[0]._path === route.path,
  19. 'text-zinc-400 hover:text-white': navigation[0]._path != route.path
  20. }">
  21. <span class="pl-4 truncate"
  22. :class="{
  23. '-ml-[1px] border-l border-blue-500': navigation[0]._path === route.path
  24. }">{{ navigation[0].title }}</span>
  25. </NuxtLink>
  26. </li>
  27. </ul>
  28. </div>
  29. </li>
  30. <DocsNavigationGroup
  31. v-for="(group, groupIndex) in navigation[0].children"
  32. :key="'navigation-group-'+groupIndex"
  33. :group="group"
  34. :toc="toc"
  35. :class="{
  36. 'md:mt-0': groupIndex === 0
  37. }"
  38. />
  39. <li class="sticky bottom-0 z-10 mt-6 min-[416px]:hidden">
  40. <AppLink :href="'#'" :variant="'filled'" class="w-full">
  41. Sign in
  42. </AppLink>
  43. </li>
  44. </ul>
  45. </nav>
  46. </template>
  47. <script setup>
  48. const route = useRoute();
  49. const { navigation, toc } = useContent();
  50. </script>