git commit -m 更新lowcode-editor-skeleton

This commit is contained in:
荣彬 2020-07-31 21:31:59 +08:00
parent 521a0a1b41
commit eff31183c1
2 changed files with 17 additions and 13 deletions

View File

@ -17,7 +17,7 @@
"dependencies": {
"@ali/lowcode-designer": "^0.9.31",
"@ali/lowcode-editor-core": "^0.8.24",
"@ali/lowcode-editor-skeleton": "^0.8.37",
"@ali/lowcode-editor-skeleton": "^0.8.38-beta1",
"@ali/lowcode-plugin-designer": "^0.9.31",
"@ali/lowcode-plugin-outline-pane": "^0.8.37",
"@ali/ve-i18n-util": "^2.0.0",

View File

@ -41,19 +41,21 @@ const pages = Object.assign(project, {
if (componentsTree[0]) {
componentsTree[0].componentName = componentsTree[0].componentName || 'Page';
// FIXME
if (componentsTree[0].componentName === 'Page' ||
componentsTree[0].componentName === 'Component') {
if (componentsTree[0].componentName === 'Page' || componentsTree[0].componentName === 'Component') {
componentsTree[0].lifeCycles = {};
componentsTree[0].methods = {};
}
}
}
project.load({
version: '1.0.0',
componentsMap: [],
componentsTree,
}, true);
project.load(
{
version: '1.0.0',
componentsMap: [],
componentsTree,
},
true,
);
},
addPage(data: OldPageData | RootSchema) {
if (isPageDataV1(data)) {
@ -90,18 +92,20 @@ const pages = Object.assign(project, {
return project.onCurrentDocumentChange(fn);
},
toData() {
return project.documents.map(doc => doc.toData());
}
return project.documents.map((doc) => doc.toData());
},
});
Object.defineProperty(pages, 'currentPage', {
get() {
return project.currentDocument;
}
})
},
});
pages.onCurrentPageChange((page: DocumentModel) => {
if (!page) { return; }
if (!page) {
return;
}
page.acceptRootNodeVisitor('NodeCache', (rootNode) => {
const visitor: NodeCacheVisitor = page.getRootNodeVisitor('NodeCache');
if (visitor) {