vp-edit-link.vue 636 B

12345678910111213141516171819202122232425262728
  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 v-if="url" class="link text-sm" :href="url" target="_blank" rel="noopener noreferrer">
  8. {{ text }}
  9. <ElIcon :size="16" style="vertical-align: text-top; line-height: 24px">
  10. <i-ri-external-link-line />
  11. </ElIcon>
  12. </a>
  13. </div>
  14. </template>
  15. <style scoped>
  16. .link {
  17. display: inline-block;
  18. font-weight: 500;
  19. }
  20. .link:hover {
  21. text-decoration: none;
  22. color: var(--brand-color);
  23. }
  24. </style>