修复双向绑定
This commit is contained in:
@@ -14,11 +14,6 @@ export default {
|
||||
fullscreen: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(v) {
|
||||
this.editor.set(v)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
const {JSONEditor} = window
|
||||
@@ -27,9 +22,9 @@ export default {
|
||||
this.editor = new JSONEditor(this.$el, {
|
||||
modes: ['code', 'form', 'tree'],
|
||||
language: 'zh-CN', mode, search, mainMenuBar, navigationBar, statusBar: true,
|
||||
onChangeJSON: json => {
|
||||
this.$emit("input", json)
|
||||
}
|
||||
onChange: () => {
|
||||
this.$emit("input", this.editor.get())
|
||||
},
|
||||
}, this.value)
|
||||
} else setTimeout(() => this.init(), 500)
|
||||
const fullscreenBtn = document.querySelector(".fullscreenBtn")
|
||||
|
||||
Reference in New Issue
Block a user