Skip to content

Commit

Permalink
fix: make props original reactive (#110)
Browse files Browse the repository at this point in the history
Co-authored-by: 唐宗超 <[email protected]>
  • Loading branch information
Backlighting-Neo and 唐宗超 authored May 19, 2020
1 parent 0196701 commit 1f70359
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/MonacoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ export default {
}
},

original(newValue) {
if (this.editor && this.diffEditor) {
const editor = this.getOriginalEditor()
if (newValue !== editor.getValue()) {
editor.setValue(newValue)
}
}
},

language(newVal) {
if (this.editor) {
const editor = this.getModifiedEditor()
Expand Down Expand Up @@ -137,6 +146,10 @@ export default {
return this.diffEditor ? this.editor.getModifiedEditor() : this.editor
},

getOriginalEditor() {
return this.diffEditor ? this.editor.getOriginalEditor() : this.editor
},

focus() {
this.editor.focus()
}
Expand Down

0 comments on commit 1f70359

Please sign in to comment.