mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 05:48:17 +00:00
fix:js面板每次打开的时候重新获取最新schema
This commit is contained in:
parent
3c39c33694
commit
cb72e4ce92
@ -72,6 +72,8 @@ export default class SourceEditor extends Component<{
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 插件面板关闭事件,监听规则同上
|
// 插件面板关闭事件,监听规则同上
|
||||||
editor.on('skeleton.panel-dock.unactive',(pluginName,dock)=>{
|
editor.on('skeleton.panel-dock.unactive',(pluginName,dock)=>{
|
||||||
if (pluginName == 'sourceEditor'){
|
if (pluginName == 'sourceEditor'){
|
||||||
@ -79,8 +81,14 @@ export default class SourceEditor extends Component<{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let schema = editor.get('designer').project.getSchema();
|
// 插件面板打开事件,监听规则同上
|
||||||
this.initCode(schema);
|
editor.on('skeleton.panel-dock.active',(pluginName,dock)=>{
|
||||||
|
if (pluginName == 'sourceEditor'){
|
||||||
|
this.initCode();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.initCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,7 +129,9 @@ export default class SourceEditor extends Component<{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
initCode = (schema) => {
|
initCode = () => {
|
||||||
|
const {editor} = this.props;
|
||||||
|
let schema = editor.get('designer').project.getSchema();
|
||||||
let jsCode = js_beautify(transfrom.schema2Code(schema), { indent_size: 2, indent_empty_lines: true });
|
let jsCode = js_beautify(transfrom.schema2Code(schema), { indent_size: 2, indent_empty_lines: true });
|
||||||
let css;
|
let css;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user