画布清除
This commit is contained in:
@@ -249,7 +249,11 @@
|
||||
|
||||
})
|
||||
onBeforeMount(() => {
|
||||
eventManager.removeEvents() // 移除事件
|
||||
stateManager.dispose()
|
||||
eventManager.dispose()
|
||||
flowManager.dispose()
|
||||
nodeManager.dispose()
|
||||
toolManager.dispose()
|
||||
})
|
||||
</script>
|
||||
<style lang="less">
|
||||
|
||||
@@ -81,4 +81,7 @@ export class EventManager {
|
||||
// document.removeEventListener('copy', this.handleCopy.bind(this))
|
||||
document.removeEventListener('keydown', this.handleKeyDown.bind(this))
|
||||
}
|
||||
dispose() {
|
||||
this.removeEvents()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,5 @@ export class FlowManager {
|
||||
return this.vueFlow.value.getNodes?.find((v) => v.data.superiorID === id)
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,8 @@ export class GenerateManager {
|
||||
})
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.taskIds = []
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,4 +133,5 @@ export class NodeManager {
|
||||
delete node_.data?.disableDelete
|
||||
this.stateManager.addNode(node_)
|
||||
}
|
||||
dispose() {}
|
||||
}
|
||||
|
||||
@@ -183,4 +183,8 @@ export class StateManager {
|
||||
this.nodes.value = JSON.parse(state.nodes)
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.historyList.value = []
|
||||
this.historyIndex.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,5 +43,5 @@ export class ToolManager {
|
||||
this.stateManager.setPanOnDrag(!!tool.panOnDrag)
|
||||
this.stateManager.setCursor(tool.cursor || "")
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user