Browse Source

10.31关闭websocket

liuqiao 1 năm trước cách đây
mục cha
commit
181ca391a0
1 tập tin đã thay đổi với 15 bổ sung0 xóa
  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>