添加历史代码功能

This commit is contained in:
fofolee
2022-03-31 21:18:45 +08:00
parent 4d07847196
commit 27e077b56b
8 changed files with 104 additions and 36 deletions

View File

@@ -5,7 +5,7 @@
<script>
import * as monaco from "monaco-editor";
import { toRaw } from "vue";
import importAll from "../api/importAll.js";
import importAll from "../js/importAll.js";
// 批量导入声明文件
let apis = importAll(
@@ -135,6 +135,9 @@ export default {
getEditorValue() {
return toRaw(this.editor).getValue();
},
setEditorValue(value) {
toRaw(this.editor).setValue(value);
},
setEditorLanguage(language) {
monaco.editor.setModelLanguage(this.editor.getModel(), language);
},