liuqiao пре 1 година
родитељ
комит
181ca391a0
1 измењених фајлова са 15 додато и 0 уклоњено
  1. 15 0
      src/views/index/HCFDLab/echartsHFCD.vue

+ 15 - 0
src/views/index/HCFDLab/echartsHFCD.vue

@@ -394,6 +394,21 @@ export default {
     },
   
   },
+    beforeDestroy() {
+    this.websock.close();
+    // 清除时间
+    clearTimeout(this.timeoutObj);
+    clearTimeout(this.serverTimeoutObj);
+  },
+  destroyed() {
+    this.websock.close();
+    //this.websock=null;
+    //console.log( this.websock.close());
+    // 清除时间
+    clearTimeout(this.timeoutObj);
+    clearTimeout(this.serverTimeoutObj);
+    console.log("关闭了websocket")
+  },
   
 };
 </script>