|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
import { normalizeLink } from '../support/utils'
|
|
|
|
|
import VPIconExternalLink from './icons/VPIconExternalLink.vue'
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
@ -15,7 +16,7 @@ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
|
|
|
|
|
:is="href ? 'a' : 'span'"
|
|
|
|
|
class="VPLink"
|
|
|
|
|
:class="{ link: href }"
|
|
|
|
|
:href="href"
|
|
|
|
|
:href="href ? normalizeLink(href) : undefined"
|
|
|
|
|
:target="isExternal ? '_blank' : undefined"
|
|
|
|
|
:rel="isExternal ? 'noopener noreferrer' : undefined"
|
|
|
|
|
>
|
|
|
|
|