Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/Menu.vue
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | export default { | ||||
}, | }, | ||||
computed: { | computed: { | ||||
loggedIn() { return this.$store.state.isLoggedIn }, | loggedIn() { return this.$store.state.isLoggedIn }, | ||||
menu() { return this.menuList.filter(item => !item.footer || this.mode == 'footer') }, | menu() { return this.menuList.filter(item => !item.footer || this.mode == 'footer') }, | ||||
route() { return this.$route.name } | route() { return this.$route.name } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
this.menuList = this.loadMenu() | this.menuList = this.loadMenu() | ||||
// On mobile close the menu when the menu item is clicked | |||||
if (this.mode == 'header') { | |||||
$('#header-menu .navbar').on('click', function() { $(this).removeClass('show') }) | |||||
} | |||||
}, | }, | ||||
methods: { | methods: { | ||||
loadMenu() { | loadMenu() { | ||||
let menu = [] | let menu = [] | ||||
const lang = this.getLang() | const lang = this.getLang() | ||||
const loggedIn = this.loggedIn | const loggedIn = this.loggedIn | ||||
window.config.menu.forEach(item => { | window.config.menu.forEach(item => { | ||||
Show All 33 Lines |