diff --git a/packages/editor/src/services/editor.ts b/packages/editor/src/services/editor.ts index b1ffdb56..3679d57d 100644 --- a/packages/editor/src/services/editor.ts +++ b/packages/editor/src/services/editor.ts @@ -289,8 +289,6 @@ class Editor extends BaseService { if (!info.node) throw new Error(`获取不到id为${config.id}的节点`); const node = cloneDeep(toRaw(info.node)); - const { parent } = info; - if (!parent) throw new Error('获取不到父级节点'); let newConfig = await this.toggleFixedPosition(toRaw(config), node, this.get('root')); @@ -303,6 +301,9 @@ class Editor extends BaseService { return newConfig; } + const { parent } = info; + if (!parent) throw new Error('获取不到父级节点'); + const parentNodeItems = parent.items; const index = getNodeIndex(newConfig, parent);