This commit is contained in:
2024-03-07 14:07:11 +02:00
parent 005ac4225b
commit df73dcde7e
3 changed files with 12 additions and 5 deletions

View File

@ -28,16 +28,22 @@ export default {
},
},
mounted() {
console.log(monacoResultInst);
loader.init().then((monaco) => {
monacoResultInst = monaco;
monaco.editor.create(document.querySelector(`#${this.name}`), {
value: '',
value: this.value,
language: this.language,
readOnly: this.readonly,
});
});
},
unmounted() {
if (monacoResultInst) {
monacoResultInst.editor.getModels().forEach(model => model.dispose());
}
},
watch: {
value: {
// the callback will be called immediately after the start of the observation