fix(editor): react runtime中添加没有即使渲染

This commit is contained in:
roymondchen 2022-08-16 14:38:28 +08:00 committed by jia000
parent 79cee1cbdc
commit 9d2e2210d1

View File

@ -296,6 +296,9 @@ class Editor extends BaseService {
throw new Error('app下不能添加组件');
}
// 新增节点添加到配置中
parent?.items?.push(node);
const layout = await this.getLayout(toRaw(parent), node as MNode);
node.style = getInitPositionStyle(node.style, layout);
@ -305,9 +308,6 @@ class Editor extends BaseService {
await stage?.update({ config: cloneDeep(node), root: cloneDeep(root) });
// 新增节点添加到配置中
parent?.items?.push(node);
this.addModifiedNodeId(node.id);
return node;