From 7d399b436bfb670d6a70a75cf4e3557e7a3f421e 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: Wed, 4 Dec 2024 18:49:23 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E4=B8=8A=E7=A7=BB=E3=80=81?= =?UTF-8?q?=E4=B8=8B=E7=A7=BB=E5=91=BD=E4=BB=A4=E6=94=AF=E6=8C=81=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=93=8D=E4=BD=9C=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/Render.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/simple-mind-map/src/core/render/Render.js b/simple-mind-map/src/core/render/Render.js index eeacc7b2..d1164a1f 100644 --- a/simple-mind-map/src/core/render/Render.js +++ b/simple-mind-map/src/core/render/Render.js @@ -988,11 +988,12 @@ class Render { } // 上移节点,多个节点只会操作第一个节点 - upNode() { - if (this.activeNodeList.length <= 0) { + upNode(appointNode) { + if (this.activeNodeList.length <= 0 && !appointNode) { return } - let node = this.activeNodeList[0] + const list = appointNode ? [appointNode] : this.activeNodeList + const node = list[0] if (node.isRoot) { return } @@ -1013,11 +1014,12 @@ class Render { } // 下移节点,多个节点只会操作第一个节点 - downNode() { - if (this.activeNodeList.length <= 0) { + downNode(appointNode) { + if (this.activeNodeList.length <= 0 && !appointNode) { return } - let node = this.activeNodeList[0] + const list = appointNode ? [appointNode] : this.activeNodeList + const node = list[0] if (node.isRoot) { return } @@ -1594,7 +1596,7 @@ class Render { this.setNodeDataRender(node, data) // 更新了连线的样式 if (lineStyleProps.includes(prop)) { - ;(node.parent || node).renderLine(true) + (node.parent || node).renderLine(true) } } @@ -1618,7 +1620,7 @@ class Render { } }) if (hasLineStyleProps) { - ;(node.parent || node).renderLine(true) + (node.parent || node).renderLine(true) } }