Skip to content

Commit

Permalink
fix(ui): disable scrollbar when sidebar in open
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Mar 28, 2019
1 parent 0a64ac6 commit 3451ab2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/SidebarToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ export default {
toggleSidebar() {
this.$store.commit('TOGGLE_SIDEBAR')
}
},
watch: {
'$store.state.showSidebar'(show) {
if (show) {
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = 'initial'
}
}
}
}
</script>
Expand Down

0 comments on commit 3451ab2

Please sign in to comment.