From 8487e148ea9a2f211de541e7f7a8e656d533226d 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: Thu, 22 Feb 2024 10:18:00 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9AINSERT=5FNODE=E3=80=81INSERT=5FMUL?= =?UTF-8?q?IT=5FNODE=E3=80=81INSERT=5FCHILD=5FNODE=E3=80=81INSERT=5FMULIT?= =?UTF-8?q?=5FCHILD=5FNODE=E5=91=BD=E4=BB=A4=E4=B8=8D=E4=BC=9A=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E6=8C=87=E5=AE=9A=E6=96=B0=E6=8F=92=E5=85=A5=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=95=B0=E6=8D=AE=E7=9A=84uid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/Render.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/simple-mind-map/src/core/render/Render.js b/simple-mind-map/src/core/render/Render.js index a907b071..13d290d7 100644 --- a/simple-mind-map/src/core/render/Render.js +++ b/simple-mind-map/src/core/render/Render.js @@ -649,7 +649,7 @@ class Render { uid: createUid(), ...(appointData || {}) }, - children: [...createUidForAppointNodes(appointChildren, true)] + children: [...createUidForAppointNodes(appointChildren)] } parent.nodeData.children.splice(index + 1, 0, newNodeData) }) @@ -685,10 +685,7 @@ class Render { const parent = node.parent // 计算插入位置 const index = getNodeDataIndex(node) - const newNodeList = createUidForAppointNodes( - simpleDeepClone(nodeList), - true - ) + const newNodeList = createUidForAppointNodes(simpleDeepClone(nodeList)) parent.nodeData.children.splice(index + 1, 0, ...newNodeList) }) if (focusNewNode) { @@ -748,7 +745,7 @@ class Render { ...params, ...(appointData || {}) }, - children: [...createUidForAppointNodes(appointChildren, true)] + children: [...createUidForAppointNodes(appointChildren)] } node.nodeData.children.push(newNode) // 插入子节点时自动展开子节点 @@ -788,7 +785,7 @@ class Render { if (!node.nodeData.children) { node.nodeData.children = [] } - childList = createUidForAppointNodes(childList, true) + childList = createUidForAppointNodes(childList) node.nodeData.children.push(...childList) // 插入子节点时自动展开子节点 node.setData({