forked from AkkomaGang/admin-fe
Hide Invites menu item if invites are disabled
This commit is contained in:
parent
9010cbbf3f
commit
d0af7e4907
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
|
<div v-if="!item.hidden && item.children && invitesEnabled" class="menu-wrapper">
|
||||||
|
|
||||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||||
<app-link :to="resolvePath(onlyOneChild.path)">
|
<app-link :to="resolvePath(onlyOneChild.path)">
|
||||||
|
@ -68,6 +68,11 @@ export default {
|
||||||
onlyOneChild: null
|
onlyOneChild: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
invitesEnabled() {
|
||||||
|
return this.basePath === '/invites' ? this.$store.state.app.invitesEnabled : true
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hasOneShowingChild(children, parent) {
|
hasOneShowingChild(children, parent) {
|
||||||
const showingChildren = children.filter(item => {
|
const showingChildren = children.filter(item => {
|
||||||
|
|
Loading…
Reference in a new issue