From da7a5add3394de75cd6abd51e10213be3cb1b6e1 Mon Sep 17 00:00:00 2001
From: Marie <github@yuugi.dev>
Date: Wed, 2 Oct 2024 20:11:41 +0200
Subject: upd: use @click.prevent instead of @click

---
 packages/frontend/src/components/MkLink.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/MkLink.vue')

diff --git a/packages/frontend/src/components/MkLink.vue b/packages/frontend/src/components/MkLink.vue
index b5cd67f7ec..d2819f9f4c 100644
--- a/packages/frontend/src/components/MkLink.vue
+++ b/packages/frontend/src/components/MkLink.vue
@@ -5,10 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only
 
 <template>
 <component
-	:is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :to="url.substring(local.length)" :rel="rel ?? 'nofollow noopener'" :target="target"
+	:is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :[attr]="self ? url.substring(local.length) : url" :rel="rel ?? 'nofollow noopener'" :target="target"
 	:behavior="props.navigationBehavior"
 	:title="url"
-	@click="self ? true : promptConfirm()"
+	@click.prevent="self ? true : promptConfirm()"
 	@click.stop
 >
 	<slot></slot>
@@ -33,6 +33,7 @@ const props = withDefaults(defineProps<{
 });
 
 const self = props.url.startsWith(local);
+const attr = self ? 'to' : 'href';
 const target = self ? null : '_blank';
 
 const el = ref<HTMLElement | { $el: HTMLElement }>();
-- 
cgit v1.2.3-freya

