From fbd061e8b31ed9c2d3a971500bb6bf57981daf09 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Sat, 12 Aug 2023 15:43:10 +0800 Subject: [PATCH] =?UTF-8?q?Demo:=E4=BF=AE=E5=A4=8D=E5=A4=A7=E7=BA=B2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AA=E8=8A=82=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E5=86=8D=E7=82=B9=E5=87=BB=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E8=8A=82=E7=82=B9=E6=97=B6=E4=B8=8D=E8=81=9A=E7=84=A6?= =?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/Outline.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/src/pages/Edit/components/Outline.vue b/web/src/pages/Edit/components/Outline.vue index fa1fe23b..615ae042 100644 --- a/web/src/pages/Edit/components/Outline.vue +++ b/web/src/pages/Edit/components/Outline.vue @@ -75,6 +75,7 @@ export default { window.addEventListener('keydown', this.onKeyDown) this.$bus.$on('data_change', this.handleDataChange) this.$bus.$on('node_tree_render_end', this.handleNodeTreeRenderEnd) + this.$bus.$on('hide_text_edit', this.handleHideTextEdit) }, mounted() { this.refresh() @@ -83,8 +84,16 @@ export default { window.removeEventListener('keydown', this.onKeyDown) this.$bus.$off('data_change', this.handleDataChange) this.$bus.$off('node_tree_render_end', this.handleNodeTreeRenderEnd) + this.$bus.$off('hide_text_edit', this.handleHideTextEdit) }, methods: { + handleHideTextEdit() { + if (this.notHandleDataChange) { + this.notHandleDataChange = false + this.refresh() + } + }, + handleDataChange() { // 在大纲里操作节点时不要响应该事件,否则会重新刷新树 if (this.notHandleDataChange) { @@ -191,6 +200,7 @@ export default { const text = richText ? e.target.innerHTML : e.target.innerText const targetNode = this.mindMap.renderer.findNodeByUid(node.data.uid) if (!targetNode) return + this.notHandleDataChange = true if (richText) { targetNode.setText(textToNodeRichTextWithWrap(text), true, true) } else {