mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(editor): runtime add api中parent参数加回去
This commit is contained in:
parent
b1bd7a870e
commit
2cde4bb5a0
@ -302,7 +302,12 @@ class Editor extends BaseService {
|
||||
const layout = await this.getLayout(toRaw(parent), node as MNode);
|
||||
node.style = getInitPositionStyle(node.style, layout);
|
||||
|
||||
await stage?.add({ config: cloneDeep(node), parentId: parent.id, root: cloneDeep(root) });
|
||||
await stage?.add({
|
||||
config: cloneDeep(node),
|
||||
parent: cloneDeep(parent),
|
||||
parentId: parent.id,
|
||||
root: cloneDeep(root),
|
||||
});
|
||||
|
||||
node.style = fixNodePosition(node, parent, stage);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
import { MoveableOptions } from 'moveable';
|
||||
|
||||
import Core from '@tmagic/core';
|
||||
import type { Id, MApp, MNode } from '@tmagic/schema';
|
||||
import type { Id, MApp, MContainer, MNode } from '@tmagic/schema';
|
||||
|
||||
import { GuidesType } from './const';
|
||||
import StageCore from './StageCore';
|
||||
@ -118,6 +118,7 @@ export interface SortEventData {
|
||||
|
||||
export interface UpdateData {
|
||||
config: MNode;
|
||||
parent?: MContainer;
|
||||
parentId: Id;
|
||||
root: MApp;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user