@tmagic/editor 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -938,9 +938,6 @@
938
938
  if (!info.node)
939
939
  throw new Error(`\u83B7\u53D6\u4E0D\u5230id\u4E3A${config2.id}\u7684\u8282\u70B9`);
940
940
  const node = lodashEs.cloneDeep(vue.toRaw(info.node));
941
- const { parent } = info;
942
- if (!parent)
943
- throw new Error("\u83B7\u53D6\u4E0D\u5230\u7236\u7EA7\u8282\u70B9");
944
941
  let newConfig = await this.toggleFixedPosition(vue.toRaw(config2), node, this.get("root"));
945
942
  defaults(newConfig, node);
946
943
  if (!newConfig.type)
@@ -949,6 +946,9 @@
949
946
  this.set("root", newConfig);
950
947
  return newConfig;
951
948
  }
949
+ const { parent } = info;
950
+ if (!parent)
951
+ throw new Error("\u83B7\u53D6\u4E0D\u5230\u7236\u7EA7\u8282\u70B9");
952
952
  const parentNodeItems = parent.items;
953
953
  const index = getNodeIndex(newConfig, parent);
954
954
  if (!parentNodeItems || typeof index === "undefined" || index === -1)