fix: 🐛 error when quick search

This commit is contained in:
林熠 2020-05-11 23:39:48 +08:00
parent 242ec93e48
commit 801d954417

View File

@ -41,7 +41,6 @@ export class DocumentModel {
private seqId = 0; private seqId = 0;
private _simulator?: ISimulatorHost; private _simulator?: ISimulatorHost;
/** /**
* *
*/ */
@ -119,7 +118,6 @@ export class DocumentModel {
// return this.addonsData[name]; // return this.addonsData[name];
// } // }
/** /**
* id * id
*/ */
@ -240,12 +238,12 @@ export class DocumentModel {
node.remove(); node.remove();
} }
getAddonData(name: string) { getAddonData(name: string) {
const addon = this.getNode(name) const addon = this.getNode(name);
if (addon) { if (addon) {
// 无法确定是否有这个api // 无法确定是否有这个api
// return addon.exportData(); // return addon.exportData();
} }
return addon return addon;
} }
@obx.ref private _dropLocation: DropLocation | null = null; @obx.ref private _dropLocation: DropLocation | null = null;
@ -485,7 +483,8 @@ export class DocumentModel {
// add toData // add toData
toData() { toData() {
return { componentsTree: [this.project?.currentDocument?.export(TransformStage.Save)] }; const node = this.project?.currentDocument?.export(TransformStage.Serilize);
return { componentsTree: [node] };
} }
getHistory(): History { getHistory(): History {