11
This commit is contained in:
@@ -7,6 +7,7 @@ export class EventManager {
|
||||
this.stateManager = options.stateManager;
|
||||
this.vueFlow = options.vueFlow
|
||||
this.zoom = this.stateManager.zoom
|
||||
this._handleKeyDown = this.handleKeyDown.bind(this)
|
||||
}
|
||||
/** 处理视口变化 */
|
||||
handleViewportChange(e: any) {
|
||||
@@ -53,6 +54,7 @@ export class EventManager {
|
||||
this.stateManager.deleteNode(activeNodeID, { isElMessageBox: true })
|
||||
}
|
||||
/** 处理键盘事件 */
|
||||
_handleKeyDown: any
|
||||
handleKeyDown(event: any) {
|
||||
const activeNodeID = this.stateManager.activeNodeID.value;
|
||||
// const shiftKey
|
||||
@@ -73,12 +75,12 @@ export class EventManager {
|
||||
/** 注册事件 */
|
||||
registerEvents() {
|
||||
// document.addEventListener('copy', this.handleCopy.bind(this))
|
||||
document.addEventListener('keydown', this.handleKeyDown.bind(this))
|
||||
document.addEventListener('keydown', this._handleKeyDown)
|
||||
}
|
||||
/** 删除事件 */
|
||||
removeEvents() {
|
||||
// document.removeEventListener('copy', this.handleCopy.bind(this))
|
||||
document.removeEventListener('keydown', this.handleKeyDown.bind(this))
|
||||
document.removeEventListener('keydown', this._handleKeyDown)
|
||||
}
|
||||
dispose() {
|
||||
this.removeEvents()
|
||||
|
||||
Reference in New Issue
Block a user