From f9276fdb7547c5e504ddcd7660862f44e70b8044 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 9 May 2025 23:12:44 +0800 Subject: [PATCH] fix(theme): improve link handling and href binding logic --- theme/src/client/components/VPLink.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) {