|
@@ -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>
|
|
</script>
|