AppHeading3.vue 519 B

12345678910111213141516
  1. <template>
  2. <h3 :id="id">
  3. <a class="text-white hover:text-white hover:decoration-white hover:underline" v-if="id && generate" :href="`#${id}`">
  4. <slot />
  5. </a>
  6. <slot v-else />
  7. </h3>
  8. </template>
  9. <script setup lang="ts">
  10. import { useRuntimeConfig } from '#imports'
  11. defineProps<{ id?: string }>()
  12. const heading = 3
  13. const { anchorLinks } = useRuntimeConfig().public.content
  14. const generate = anchorLinks?.depth >= heading && !anchorLinks?.exclude.includes(heading)
  15. </script>