From ec9f55e068e3d45062ff67da6ff0793683432279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Mon, 3 Mar 2025 17:58:36 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9A=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=9C=AA=E7=9F=A5=E6=83=85=E5=86=B5=E4=B8=8B=E5=9C=A8?= =?UTF-8?q?=E6=A0=B9=E8=8A=82=E7=82=B9=E4=B8=8A=E7=82=B9=E5=87=BB=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E5=8F=B3=E9=94=AE=E4=BC=9A=E5=90=8C=E6=97=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=A4=E4=B8=AA=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/Contextmenu.vue | 13 ++++++++++++- web/src/pages/Edit/components/Edit.vue | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Edit/components/Contextmenu.vue b/web/src/pages/Edit/components/Contextmenu.vue index 75d6c490..f8b4fd7f 100644 --- a/web/src/pages/Edit/components/Contextmenu.vue +++ b/web/src/pages/Edit/components/Contextmenu.vue @@ -244,7 +244,8 @@ export default { enableCopyToClipboardApi: navigator.clipboard, numberType: '', numberLevel: '', - subItemsShowLeft: false + subItemsShowLeft: false, + isNodeMousedown: false } }, computed: { @@ -344,6 +345,7 @@ export default { this.$bus.$on('svg_mousedown', this.onMousedown) this.$bus.$on('mouseup', this.onMouseup) this.$bus.$on('translate', this.hide) + this.$bus.$on('node_mousedown', this.onNodeMousedown) }, beforeDestroy() { this.$bus.$off('node_contextmenu', this.show) @@ -353,6 +355,7 @@ export default { this.$bus.$off('svg_mousedown', this.onMousedown) this.$bus.$off('mouseup', this.onMouseup) this.$bus.$off('translate', this.hide) + this.$bus.$off('node_mousedown', this.onNodeMousedown) }, methods: { ...mapMutations(['setLocalConfig']), @@ -387,6 +390,10 @@ export default { }) }, + onNodeMousedown() { + this.isNodeMousedown = true + }, + // 鼠标按下事件 onMousedown(e) { if (e.which !== 3) { @@ -402,6 +409,10 @@ export default { if (!this.isMousedown) { return } + if (this.isNodeMousedown) { + this.isNodeMousedown = false + return + } this.isMousedown = false if ( Math.abs(this.mosuedownX - e.clientX) > 3 || diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 9a680285..3c894600 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -593,7 +593,8 @@ export default { 'node_attachmentContextmenu', 'demonstrate_jump', 'exit_demonstrate', - 'node_note_dblclick' + 'node_note_dblclick', + 'node_mousedown' ].forEach(event => { this.mindMap.on(event, (...args) => { this.$bus.$emit(event, ...args)