AppSide.vue 687 B

12345678910111213141516171819202122232425262728293031
  1. <script setup lang="ts">
  2. const navigation = inject(navigationInjectionKey)
  3. const route = useRoute()
  4. const { headerLinks } = useHeaderLinks()
  5. const links = computed(() => headerLinks.value ?? [])
  6. const asideNavigation = computed(() => {
  7. const localPath = [route.params.slug?.[0]].filter(Boolean).join('/')
  8. const result = navPageFromPath(`/${localPath}`, navigation?.value || [])?.children || []
  9. return result
  10. })
  11. </script>
  12. <template>
  13. <UPageAside>
  14. <UPageAnchors :links="links" />
  15. <USeparator
  16. type="dashed"
  17. class="my-6"
  18. />
  19. <UContentNavigation
  20. class="pr-4"
  21. highlight
  22. :navigation="asideNavigation"
  23. />
  24. </UPageAside>
  25. </template>