Browse Source

fix: 流程管理页面卡住问题

wuwenyi 8 hours ago
parent
commit
b350248d7c
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/views/flow/designer/index.vue

+ 10 - 4
src/views/flow/designer/index.vue

@@ -823,9 +823,11 @@ async function loadRoles() {
 }
 
 onMounted(() => {
-  // 防止快速进入/离开设计器时重复创建 LogicFlow 实例
+  // 防止快速进入/离开设计器时重复创建 LogicFlow 实例(v1.x 无 destroy 方法)
   if (lf) {
-    lf.destroy()
+    if (typeof lf.destroy === 'function') {
+      lf.destroy()
+    }
     lf = null
   }
   nextTick(initLogicFlow)
@@ -833,8 +835,12 @@ onMounted(() => {
 })
 
 onUnmounted(() => {
-  lf?.destroy()
-  lf = null
+  if (lf) {
+    if (typeof lf.destroy === 'function') {
+      lf.destroy()
+    }
+    lf = null
+  }
   selectedNode.value = null
 })
 </script>