diff --git a/theme/src/client/components/VPLink.vue b/theme/src/client/components/VPLink.vue index 75d6d4f4..9f520be4 100644 --- a/theme/src/client/components/VPLink.vue +++ b/theme/src/client/components/VPLink.vue @@ -19,10 +19,9 @@ const tag = computed(() => props.tag ?? (props.href ? 'a' : 'span')) const { link, isExternal } = useLink(toRef(props, 'href'), toRef(props, 'target')) function linkTo(e: Event) { - if (!isExternal.value) { + if (!isExternal.value && link.value) { e.preventDefault() - if (link.value) - router.push(link.value) + router.push(link.value) } } @@ -30,7 +29,7 @@ function linkTo(e: Event) {