mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enhance problem_files page
This commit is contained in:
1 parent
1acd2ff0bb
commit
9158550139
5 files changed
+25
-23
No files matched your search
@@ -75,7 +75,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
this.model = typeof model === 'string'
|
||||
? monaco.editor.getModel(monaco.Uri.parse(model))
|
||||
|| monaco.editor.createModel(value, language, monaco.Uri.parse(model))
|
||||
|| monaco.editor.createModel(value, language === 'auto' ? undefined : language, monaco.Uri.parse(model))
|
||||
: model;
|
||||
this.model.setValue(value);
|
||||
const cfg: import('../monaco').default.editor.IStandaloneEditorConstructionOptions = {
|
||||
@@ -195,11 +195,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
if (!this.isValid) throw new Error('Editor is not loaded');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string?} val
|
||||
* @returns {string}
|
||||
*/
|
||||
value(val) {
|
||||
value(val?: string) {
|
||||
this.ensureValid();
|
||||
if (typeof val === 'string') return (this.editor || this.vditor).setValue(val);
|
||||
return (this.editor || this.vditor).getValue();
|
||||
|
||||
Reference in new issue
Block a user