From 53b8aa26b55e6b92429e38d8b7800db8e0f7956b Mon Sep 17 00:00:00 2001 From: wzw Date: Mon, 11 Nov 2024 17:05:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(extension):=20=E3=80=90dynamic-group?= =?UTF-8?q?=E3=80=91DynamicGroup=20=E8=A2=AB=E5=A4=8D=E5=88=B6=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E9=83=A8=E7=9A=84=E8=8A=82=E7=82=B9=E5=BD=92?= =?UTF-8?q?=E5=B1=9E=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DynamicGroup 重写的 addElements 用原分组节点创建新的时,移除的 children 取值有问题,children 应该在 properties 中 Closes #1956 --- packages/extension/src/dynamic-group/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/extension/src/dynamic-group/index.ts b/packages/extension/src/dynamic-group/index.ts index 63cff3598..689d13104 100644 --- a/packages/extension/src/dynamic-group/index.ts +++ b/packages/extension/src/dynamic-group/index.ts @@ -667,8 +667,11 @@ export class DynamicGroup { forEach(selectedNodes, (node) => { const originId = node.id - const { children, ...rest } = node - const model = lf.addNode(rest) + const { children, properties, ...rest } = node + const newProperties = { ...properties } + delete newProperties.children + const newNodeConfig = { ...rest, properties: newProperties } + const model = lf.addNode(newNodeConfig) if (originId) nodeIdMap[originId] = model.id elements.nodes.push(model) // 此时为 group 的 nodeModel