Rework routing to make sidebar dependent on child routes

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-12-23 21:57:43 +01:00
parent ef06f21d2a
commit acd85eb097
5 changed files with 66 additions and 22 deletions

View File

@@ -23,9 +23,6 @@
<template>
<div class="sidebar">
<div class="sidebar-header">
<a class="icon-close" title="Close" @click="closeSidebar">
<span class="hidden-visually">Close</span>
</a>
<h3>{{ board.title }}</h3>
</div>
@@ -56,16 +53,12 @@
<script>
import { Avatar } from 'nextcloud-vue'
import { mapState } from 'vuex'
export default {
name: 'BoardSidebar',
components: { Avatar },
props: {
board: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
@@ -90,6 +83,11 @@ export default {
]
}
},
computed: {
...mapState({
board: state => state.currentBoard
})
},
methods: {
closeSidebar() {
this.$store.dispatch('toggleSidebar')