fix: 修复复制组件问题 to #34464969

This commit is contained in:
jianhui.fjh 2021-06-23 17:02:32 +08:00
parent a2c8bc26f1
commit 6827ac3650

View File

@ -439,8 +439,9 @@ const builtinComponentActions: ComponentAction[] = [
const { isRGL, rglNode } = node.getRGL();
if (isRGL) {
// 复制layout信息
let layout = rglNode.getPropValue('layout');
let layout = rglNode.getPropValue('layout') || [];
let curLayout = layout.filter((item) => item.i === node.getPropValue('fieldId'));
if (curLayout && curLayout[0]) {
layout.push({
...curLayout[0],
i: newNode.getPropValue('fieldId'),
@ -450,6 +451,7 @@ const builtinComponentActions: ComponentAction[] = [
setTimeout(() => newNode.document.simulator?.scrollToNode(newNode), 10);
}
}
}
},
},
important: true,