add close button to sidebar

This commit is contained in:
Thomas Amland
2020-08-19 18:39:11 +02:00
parent d08118bfad
commit 0dccb04bd5
5 changed files with 28 additions and 16 deletions
+2
View File
@@ -21,6 +21,7 @@
BIconBoxArrowRight,
BIconPersonFill,
BIconPersonCircle,
BIconX,
} from 'bootstrap-vue'
export default Vue.extend({
@@ -42,6 +43,7 @@
BIconBoxArrowRight,
BIconPersonFill,
BIconPersonCircle,
BIconX,
},
props: {
icon: { type: String, required: true }
+8 -2
View File
@@ -34,8 +34,8 @@ const setupRootModule = (authService: AuthService, api: API): Module<State, any>
state.username = username
state.server = server
},
toggleMenu(state) {
state.showMenu = !state.showMenu
setMenuVisible(state, visible) {
state.showMenu = visible
},
setPlaylists(state, playlists: any[]) {
state.playlists = playlists
@@ -46,6 +46,12 @@ const setupRootModule = (authService: AuthService, api: API): Module<State, any>
},
},
actions: {
showMenu({ commit }) {
commit('setMenuVisible', true)
},
hideMenu({ commit }) {
commit('setMenuVisible', false)
},
loadPlaylists({ commit }) {
api.getPlaylists().then(result => {
commit('setPlaylists', result)