Browse Source

顶部页签右键bug修复

QM303176530 4 years ago
parent
commit
f253446cd0
1 changed files with 8 additions and 8 deletions
  1. 8 8
      web/src/view/layout/aside/historyComponent/history.vue

+ 8 - 8
web/src/view/layout/aside/historyComponent/history.vue

@@ -41,6 +41,12 @@ export default {
     }
   },
   created() {
+    this.$bus.on('mobile',(isMobile)=>{
+      this.isMobile = isMobile
+    })
+    this.$bus.on('collapse',(isCollapse)=>{
+      this.isCollapse = isCollapse
+    })
     const initHistorys = [
       {
         name: 'dashboard',
@@ -53,16 +59,10 @@ export default {
       JSON.parse(sessionStorage.getItem('historys')) || initHistorys
     this.setTab(this.$route)
   },
-  mounted() {
-    this.$bus.on('collapse',(isCollapse)=>{
-      this.isCollapse = isCollapse
-    })
-    this.$bus.on('mobile'),(isMobile)=>{
-      this.isMobile = isMobile
-    }
-  },
+
   beforeDestroy(){
     this.$bus.off('collapse')
+    this.$bus.off('mobile')
   },
   methods: {
     openContextMenu(e) {