mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: external module support
This commit is contained in:
1 parent
f020923d35
commit
86ead663df
8 files changed
+29
-11
No files matched your search
@@ -25,9 +25,8 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
const value = this.props.value || '';
|
||||
const { language, theme } = this.props;
|
||||
const { load } = await import('vj/components/monaco/loader');
|
||||
console.log(load);
|
||||
const { monaco, registerAction } = await load([language]);
|
||||
this.model = monaco.editor.createModel(value, language, monaco.Uri.parse('file://model'));
|
||||
this.model = monaco.editor.createModel(value, language, monaco.Uri.parse(`file:///${UiContext.pdoc.pid || UiContext.pdoc.docId}.${language}`));
|
||||
if (this.containerElement) {
|
||||
/** @type {monaco.editor.IStandaloneEditorConstructionOptions} */
|
||||
const config = {
|
||||
@@ -108,7 +107,9 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
width: '100%',
|
||||
}}
|
||||
className="ScratchpadMonacoEditor"
|
||||
/>
|
||||
>
|
||||
<div className="loader-container"><div className="loader"></div></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user