Co-authored-by: Freeplay <Freeplay@duck.com> Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9743 Co-authored-by: Free <freeplay@duck.com> Co-committed-by: Free <freeplay@duck.com>
This commit is contained in:
parent
4714e966f1
commit
4b1af35b39
1 changed files with 19 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a :href="to" :class="active ? activeClass : null" @click.prevent="nav" @contextmenu.prevent.stop="onContextmenu" @click.stop>
|
<a :href="to" :class="active ? activeClass : null" @click="nav" @contextmenu.prevent.stop="onContextmenu" @click.stop>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
@ -80,6 +80,9 @@ function popout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function nav(ev: MouseEvent) {
|
function nav(ev: MouseEvent) {
|
||||||
|
if (!ev.ctrlKey) {
|
||||||
|
ev.preventDefault();
|
||||||
|
|
||||||
if (props.behavior === 'browser') {
|
if (props.behavior === 'browser') {
|
||||||
location.href = props.to;
|
location.href = props.to;
|
||||||
return;
|
return;
|
||||||
|
@ -99,4 +102,5 @@ function nav(ev: MouseEvent) {
|
||||||
|
|
||||||
router.push(props.to, ev.ctrlKey ? 'forcePage' : null);
|
router.push(props.to, ev.ctrlKey ? 'forcePage' : null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue