Skip to content

Commit 2de1867

Browse files
committed
fix: allow dynamic target attribute for external links in Link component
1 parent 015210c commit 2de1867

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

adminforth/spa/src/afcl/Link.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
v-if="isExternal"
44
v-bind="$attrs"
55
:href="to"
6-
target="_blank"
6+
:target="target"
77
rel="noopener noreferrer"
88
:class="linkClasses"
99
>
@@ -14,6 +14,7 @@
1414
v-else
1515
v-bind="$attrs"
1616
:to="to"
17+
:target="target"
1718
:class="linkClasses"
1819
>
1920
<slot></slot>
@@ -25,6 +26,7 @@ import { computed } from 'vue';
2526
2627
const props = defineProps<{
2728
to: string,
29+
target?: 'blank' | 'self' | 'parent' | 'top'
2830
}>();
2931
3032
const isExternal = computed(() => {

0 commit comments

Comments
 (0)