瀏覽代碼

顶部页签右键bug修复

QM303176530 4 年之前
父節點
當前提交
f253446cd0
共有 1 個文件被更改,包括 8 次插入8 次删除
  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() {
   created() {
+    this.$bus.on('mobile',(isMobile)=>{
+      this.isMobile = isMobile
+    })
+    this.$bus.on('collapse',(isCollapse)=>{
+      this.isCollapse = isCollapse
+    })
     const initHistorys = [
     const initHistorys = [
       {
       {
         name: 'dashboard',
         name: 'dashboard',
@@ -53,16 +59,10 @@ export default {
       JSON.parse(sessionStorage.getItem('historys')) || initHistorys
       JSON.parse(sessionStorage.getItem('historys')) || initHistorys
     this.setTab(this.$route)
     this.setTab(this.$route)
   },
   },
-  mounted() {
-    this.$bus.on('collapse',(isCollapse)=>{
-      this.isCollapse = isCollapse
-    })
-    this.$bus.on('mobile'),(isMobile)=>{
-      this.isMobile = isMobile
-    }
-  },
+
   beforeDestroy(){
   beforeDestroy(){
     this.$bus.off('collapse')
     this.$bus.off('collapse')
+    this.$bus.off('mobile')
   },
   },
   methods: {
   methods: {
     openContextMenu(e) {
     openContextMenu(e) {