mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 更新根节点出错
This commit is contained in:
parent
979336c052
commit
412c78153c
@ -289,8 +289,6 @@ class Editor extends BaseService {
|
|||||||
if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
|
if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
|
||||||
|
|
||||||
const node = cloneDeep(toRaw(info.node));
|
const node = cloneDeep(toRaw(info.node));
|
||||||
const { parent } = info;
|
|
||||||
if (!parent) throw new Error('获取不到父级节点');
|
|
||||||
|
|
||||||
let newConfig = await this.toggleFixedPosition(toRaw(config), node, this.get<MApp>('root'));
|
let newConfig = await this.toggleFixedPosition(toRaw(config), node, this.get<MApp>('root'));
|
||||||
|
|
||||||
@ -303,6 +301,9 @@ class Editor extends BaseService {
|
|||||||
return newConfig;
|
return newConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { parent } = info;
|
||||||
|
if (!parent) throw new Error('获取不到父级节点');
|
||||||
|
|
||||||
const parentNodeItems = parent.items;
|
const parentNodeItems = parent.items;
|
||||||
const index = getNodeIndex(newConfig, parent);
|
const index = getNodeIndex(newConfig, parent);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user