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