mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-01 15:18:47 +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);
|
const layout = await this.getLayout(toRaw(parent), node as MNode);
|
||||||
node.style = getInitPositionStyle(node.style, layout);
|
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);
|
node.style = fixNodePosition(node, parent, stage);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
import { MoveableOptions } from 'moveable';
|
import { MoveableOptions } from 'moveable';
|
||||||
|
|
||||||
import Core from '@tmagic/core';
|
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 { GuidesType } from './const';
|
||||||
import StageCore from './StageCore';
|
import StageCore from './StageCore';
|
||||||
@ -118,6 +118,7 @@ export interface SortEventData {
|
|||||||
|
|
||||||
export interface UpdateData {
|
export interface UpdateData {
|
||||||
config: MNode;
|
config: MNode;
|
||||||
|
parent?: MContainer;
|
||||||
parentId: Id;
|
parentId: Id;
|
||||||
root: MApp;
|
root: MApp;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user