From 2b8d4ae225415248e33da708543a45d5e81a9841 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, 8 Apr 2024 18:02:59 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=A6=82=E8=A6=81=E4=BC=9A=E8=A7=A6=E5=8F=91data=5Fch?= =?UTF-8?q?ange=5Fdetail=E4=BA=8B=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/utils/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/simple-mind-map/src/utils/index.js b/simple-mind-map/src/utils/index.js index 3066d477..a8014d84 100644 --- a/simple-mind-map/src/utils/index.js +++ b/simple-mind-map/src/utils/index.js @@ -157,8 +157,15 @@ export const copyRenderTree = (tree, root, removeActiveState = false) => { tree.data = simpleDeepClone(root.data) if (removeActiveState) { tree.data.isActive = false - if (tree.data.generalization) { - tree.data.generalization.isActive = false + const generalization = tree.data.generalization + if (generalization) { + if (Array.isArray(generalization)) { + generalization.forEach(item => { + item.isActive = false + }) + } else { + generalization.isActive = false + } } } tree.children = []