fix: 🐛 增加 getAddonData api

This commit is contained in:
凤矗 2020-05-07 21:42:32 +08:00
parent de50ebfd69
commit 68b7e29e3b

View File

@ -41,6 +41,7 @@ export class DocumentModel {
private seqId = 0;
private _simulator?: ISimulatorHost;
/**
*
*/
@ -110,6 +111,14 @@ export class DocumentModel {
}
readonly designer = this.project.designer;
// getAddonData(name: string) {
// const addon = this.addons.find((item) => item.name === name);
// if (addon) {
// return addon.exportData();
// }
// return this.addonsData[name];
// }
/**
* id
@ -230,6 +239,14 @@ export class DocumentModel {
this.selection.remove(node.id);
node.remove();
}
getAddonData(name: string) {
const addon = this.getNode(name)
if (addon) {
// 无法确定是否有这个api
// return addon.exportData();
}
return addon
}
@obx.ref private _dropLocation: DropLocation | null = null;
/**