2019-07-06 15:21:29 +02:00
|
|
|
<template>
|
2024-04-27 21:13:13 +02:00
|
|
|
<a class="navbar-item" :href="href" @click.stop.prevent="open">
|
2022-02-19 06:39:14 +01:00
|
|
|
<slot />
|
2019-07-06 15:21:29 +02:00
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import * as types from '@/store/mutation_types'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'NavbarItemLink',
|
2020-04-18 06:57:55 +02:00
|
|
|
props: {
|
2024-02-28 13:10:08 +01:00
|
|
|
to: { required: true, type: Object }
|
2020-04-18 06:57:55 +02:00
|
|
|
},
|
2019-07-06 15:21:29 +02:00
|
|
|
|
|
|
|
computed: {
|
2024-04-27 21:13:13 +02:00
|
|
|
href() {
|
|
|
|
return this.$router.resolve(this.to).href
|
2019-07-06 15:21:29 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2024-04-27 21:13:13 +02:00
|
|
|
open() {
|
|
|
|
if (this.$store.state.show_burger_menu) {
|
2020-04-18 06:57:55 +02:00
|
|
|
this.$store.commit(types.SHOW_BURGER_MENU, false)
|
|
|
|
}
|
2024-04-27 21:13:13 +02:00
|
|
|
if (this.$store.state.show_player_menu) {
|
2020-04-18 06:57:55 +02:00
|
|
|
this.$store.commit(types.SHOW_PLAYER_MENU, false)
|
|
|
|
}
|
2023-07-10 10:37:45 +02:00
|
|
|
this.$router.push(this.to)
|
2019-07-06 15:21:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|