vp-edit-link.vue 625 B

12345678910111213141516171819202122232425262728293031323334
  1. <script setup lang="ts">
  2. import { useEditLink } from '../../composables/edit-link'
  3. const { url, text } = useEditLink()
  4. </script>
  5. <template>
  6. <div class="edit-link">
  7. <a
  8. v-if="url"
  9. class="link text-sm"
  10. :href="url"
  11. target="_blank"
  12. rel="noopener noreferrer"
  13. >
  14. {{ text }}
  15. <ElIcon :size="16" style="vertical-align: text-top; line-height: 24px">
  16. <i-ri-external-link-line />
  17. </ElIcon>
  18. </a>
  19. </div>
  20. </template>
  21. <style scoped>
  22. .link {
  23. display: inline-block;
  24. font-weight: 500;
  25. }
  26. .link:hover {
  27. text-decoration: none;
  28. color: var(--brand-color);
  29. }
  30. </style>