39 lines
656 B
Vue
Raw Normal View History

<template>
<a :href="href" @click.stop.prevent="open">
<slot />
</a>
</template>
<script>
2024-08-22 21:31:59 +02:00
import { useUIStore } from '@/stores/ui'
export default {
name: 'ControlLink',
props: {
2024-02-28 13:10:08 +01:00
to: { required: true, type: Object }
},
2024-08-22 21:31:59 +02:00
setup() {
return { uiStore: useUIStore() }
},
computed: {
href() {
return this.$router.resolve(this.to).href
}
},
methods: {
open() {
2024-08-22 21:31:59 +02:00
if (this.uiStore.show_burger_menu) {
this.uiStore.show_burger_menu = false
}
2024-08-22 21:31:59 +02:00
if (this.uiStore.show_player_menu) {
this.uiStore.show_player_menu = false
}
this.$router.push(this.to)
}
}
}
</script>