diff --git a/hw-ui/src/layout/index.vue b/hw-ui/src/layout/index.vue index b0b7c56d..255f61e5 100644 --- a/hw-ui/src/layout/index.vue +++ b/hw-ui/src/layout/index.vue @@ -43,16 +43,28 @@ export default { TagsView }, mixins: [ResizeMixin], + mounted() { + console.log(this.sidebar) + }, watch: { 'sidebar.opened': { handler: function() { - console.log(this.sidebar.opened) if (this.sidebar.opened) { this.sidebarWidth = 200 } else { this.sidebarWidth = 54 } } + }, + 'sidebar.hide': { + handler: function() { + if (this.sidebar.hide) { + this.sidebarWidth = 54 + } else { + this.sidebar.opened = true + this.sidebarWidth = 200 + } + } } }, computed: { @@ -81,7 +93,6 @@ export default { this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) }, setLineLeft(e) { - console.log(e) let left = e.pageX if (left < 54) { left = 54