浏览代码

修复首页圆饼图不显示的问题

画安 1 天之前
父节点
当前提交
ec2fba903e
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      src/views/Home.vue

+ 4 - 5
src/views/Home.vue

@@ -477,6 +477,10 @@ onlineChart: null,
     }, 2200);
 
     window.addEventListener("resize", this.onResize, { passive: true });
+
+    this.timer = setTimeout(() => {
+      this.isNavVisible = false;
+    }, 2000); // 2000毫秒(2秒)后收起底部菜单
   },
   beforeDestroy() {
     window.removeEventListener("resize", this.updateScale);
@@ -490,11 +494,6 @@ onlineChart: null,
     // 组件销毁前清除定时器,防止内存泄漏
     if (this.timer) clearTimeout(this.timer);
   },
-  mounted () {
-    this.timer = setTimeout(() => {
-      this.isNavVisible = false;
-    }, 2000); // 2000毫秒(2秒)后收起底部菜单
-  },
   methods: {
     onMouseMove(e) {
       const rect = this.$el.getBoundingClientRect();