From 4c2bd40159a9f7cca52d5e2f7d3174b2fb34bb09 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期三, 17 八月 2022 09:36:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/intellectInspect/intelligentLine/index.vue |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/views/intellectInspect/intelligentLine/index.vue b/src/views/intellectInspect/intelligentLine/index.vue
index 8581867..da39b51 100644
--- a/src/views/intellectInspect/intelligentLine/index.vue
+++ b/src/views/intellectInspect/intelligentLine/index.vue
@@ -85,7 +85,7 @@
 <script lang="ts">
 import screenfull from 'screenfull';
 import { lineApi } from '/@/api/intelligentLine';
-import { toRefs, reactive, ref, onMounted, onUnmounted, computed } from 'vue';
+import {toRefs, reactive, ref, onMounted, onUnmounted, computed, nextTick} from 'vue';
 import {useRoute} from 'vue-router';
 import { storeToRefs } from 'pinia';
 import { initBackEndControlRoutes } from '/@/router/backEnd';
@@ -217,9 +217,11 @@
         // 页面关闭处理
         onUnmounted(() => {
             // 销毁监听
-            state.socket.onclose = () => {
-                console.log('socket已经关闭');
-            };
+            nextTick(()=>{
+                state.socket.onclose = () => {
+                    console.log('socket已经关闭');
+                };
+            })
         });
         return {
             dataList,

--
Gitblit v1.9.2