Koha/koha-tmpl/intranet-tmpl/prog/js/vue/components/LeftMenu.vue
Agustin Moyano 13fbc155d2
Bug 33169: Build breadcrumbs and left-hand side menu from routes definition
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-23 10:00:56 -03:00

67 lines
1.4 KiB
Vue

<template>
<aside>
<div id="navmenu">
<div id="navmenulist">
<h5>{{ $__(title) }}</h5>
<ul>
<NavigationItem
v-for="(item, key) in navigationTree"
v-bind:key="key"
:item="item"
></NavigationItem>
</ul>
</div>
</div>
</aside>
</template>
<script>
import { inject } from "vue"
import NavigationItem from "./NavigationItem.vue"
export default {
name: "LeftMenu",
data() {
return {
navigationTree: this.leftNavigation,
}
},
setup: () => {
const navigationStore = inject("navigationStore")
const { leftNavigation } = navigationStore
return {
leftNavigation,
}
},
async beforeMount() {
if (this.condition)
this.navigationTree = await this.condition(this.navigationTree)
},
props: {
title: String,
condition: Function,
},
components: {
NavigationItem,
},
}
</script>
<style scoped>
#navmenulist a.router-link-active {
font-weight: 700;
}
#menu ul ul,
#navmenulist ul ul {
padding-left: 2em;
font-size: 100%;
}
#navmenulist ul li a.disabled {
color: #666;
pointer-events: none;
font-weight: 700;
}
#navmenulist ul li a.disabled.router-link-active {
color: #000;
}
</style>