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