diff --git a/packages/demo/src/editor/plugins/codeout.tsx b/packages/demo/src/editor/plugins/codeout.tsx index c60aa940a..3b3aac5ef 100644 --- a/packages/demo/src/editor/plugins/codeout.tsx +++ b/packages/demo/src/editor/plugins/codeout.tsx @@ -38,7 +38,6 @@ const Codeout = ({ editor }: PluginProps) => { })); const fullSchema = { - ...designer.schema, config: { historyMode: 'hash', targetRootID: 'J_Container', @@ -47,6 +46,7 @@ const Codeout = ({ editor }: PluginProps) => { name: 'demoproject', }, componentsMap, + componentsTree: [designer.schema.componentsTree[designer.schema.componentsTree.length - 1]], }; console.info('codeout schema:', fullSchema); diff --git a/packages/demo/src/editor/plugins/saveload.tsx b/packages/demo/src/editor/plugins/saveload.tsx index fc7ba6acd..eb8582bc6 100644 --- a/packages/demo/src/editor/plugins/saveload.tsx +++ b/packages/demo/src/editor/plugins/saveload.tsx @@ -24,7 +24,7 @@ const Codeout = ({ editor }: PluginProps) => { const handleSaveClick = () => { const designer = editor.get(Designer); if (designer) { - const schema = designer.schema.componentsTree[0]; // editor.get('schema'); + const schema = designer.schema.componentsTree[designer.schema.componentsTree.length - 1]; // editor.get('schema'); const schemaStr = JSON.stringify(schema); window.localStorage.setItem('schema_data', schemaStr); console.info('save schema:', schemaStr);