Commit d8153f9d authored by rockyl's avatar rockyl

original监听

parent 13de23ce
......@@ -54,6 +54,13 @@ var MonacoEditor = {
if (this.editor) {
this.monaco.editor.setTheme(newVal);
}
},
original: function original(newVal) {
if (this.editor) {
var editor = this.getEditor();
var model = editor.getModel();
model.original.setValue(newVal);
}
}
},
mounted: function mounted() {
......
......@@ -76,6 +76,13 @@
if (this.editor) {
this.monaco.editor.setTheme(newVal);
}
},
original: function original(newVal) {
if (this.editor) {
var editor = this.getEditor();
var model = editor.getModel();
model.original.setValue(newVal);
}
}
},
mounted: function mounted() {
......
......@@ -41,7 +41,7 @@ export default {
value(newValue) {
if (this.editor) {
const editor = this.getModifiedEditor()
const editor = this.getModifiedEditor();
if (newValue !== editor.getValue()) {
editor.setValue(newValue)
}
......@@ -50,7 +50,7 @@ export default {
language(newVal) {
if (this.editor) {
const editor = this.getModifiedEditor()
const editor = this.getModifiedEditor();
this.monaco.editor.setModelLanguage(editor.getModel(), newVal)
}
},
......@@ -59,6 +59,14 @@ export default {
if (this.editor) {
this.monaco.editor.setTheme(newVal)
}
},
original(newVal) {
if (this.editor) {
const editor = this.getEditor();
let model = editor.getModel();
model.original.setValue(newVal);
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment