mirror of
https://github.com/frappe/books.git
synced 2025-01-11 10:38:14 +00:00
Configurable sidebar title and click
This commit is contained in:
parent
9d3726cf5c
commit
d59fd52ffd
@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="frappe-sidebar col-2 bg-light border-right">
|
<div class="frappe-sidebar col-2 bg-light border-right">
|
||||||
<div class="navbar border-bottom">
|
<div class="navbar border-bottom navbar-title" @click="onNavbarTitleClick">
|
||||||
<div class="navbar-text">
|
<div class="navbar-text">
|
||||||
TennisMart
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
|
<feather-icon class="mt-1" name="chevron-down" />
|
||||||
</div>
|
</div>
|
||||||
<div class="my-3" v-for="(sidebarGroup, index) in sidebarConfig" :key="index">
|
<div class="my-3" v-for="(sidebarGroup, index) in sidebarConfig.groups" :key="index">
|
||||||
<h6 v-if="sidebarGroup.title" class="sidebar-heading nav-link text-muted text-uppercase m-0">
|
<h6 v-if="sidebarGroup.title" class="sidebar-heading nav-link text-muted text-uppercase m-0">
|
||||||
{{ sidebarGroup.title }}
|
{{ sidebarGroup.title }}
|
||||||
</h6>
|
</h6>
|
||||||
@ -24,6 +25,14 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['sidebarConfig'],
|
props: ['sidebarConfig'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
this.title = await this.sidebarConfig.getTitle();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isActive(item) {
|
isActive(item) {
|
||||||
if (this.$route.params.doctype) {
|
if (this.$route.params.doctype) {
|
||||||
@ -31,12 +40,17 @@ export default {
|
|||||||
}
|
}
|
||||||
const route = item.route.slice(1);
|
const route = item.route.slice(1);
|
||||||
return this.$route.path === route;
|
return this.$route.path === route;
|
||||||
|
},
|
||||||
|
onNavbarTitleClick() {
|
||||||
|
this.sidebarConfig.onTitleClick(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
|
@import "../styles/variables";
|
||||||
|
|
||||||
.frappe-sidebar {
|
.frappe-sidebar {
|
||||||
min-height: calc(100vh);
|
min-height: calc(100vh);
|
||||||
}
|
}
|
||||||
@ -44,4 +58,11 @@ export default {
|
|||||||
.sidebar-heading {
|
.sidebar-heading {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-title {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.navbar-title:hover {
|
||||||
|
background-color: $gray-200;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user