AppHeading2.vue 822 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <DocsEyebrow
  3. v-if="tag != '' && label != ''"
  4. :tag="tag"
  5. :label="label"/>
  6. <h2 ref="headingRef" :id="id" :class="[tag != '' || label != '' ? 'mt-2 scroll-mt-32' : 'scroll-mt-24']">
  7. <DocsAnchor v-if="anchor" :href="'#'+id" :inView="inView">
  8. <slot v-if="text == ''"/>
  9. <span v-else v-text="text"></span>
  10. </DocsAnchor>
  11. </h2>
  12. </template>
  13. <script setup>
  14. /**
  15. * Look at the prose h2 for what we can do!
  16. */
  17. const props = defineProps({
  18. level: {
  19. default: 2
  20. },
  21. tag: {
  22. default: ''
  23. },
  24. label: {
  25. default: ''
  26. },
  27. anchor: {
  28. default: true
  29. },
  30. id: {
  31. default: ''
  32. },
  33. text: {
  34. default: ''
  35. }
  36. })
  37. const headingRef = ref( null );
  38. const inView = ref(true);
  39. </script>