refine
This commit is contained in:
parent
4034a76120
commit
823f45e1fc
|
@ -16,6 +16,7 @@ import 'codemirror/addon/lint/json-lint'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JsonEditor',
|
name: 'JsonEditor',
|
||||||
|
/* eslint-disable vue/require-prop-types */
|
||||||
props: ['value'],
|
props: ['value'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -24,8 +25,8 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(value) {
|
value(value) {
|
||||||
const editor_value = this.jsonEditor.getValue()
|
const editorValue = this.jsonEditor.getValue()
|
||||||
if (value !== editor_value) {
|
if (value !== editorValue) {
|
||||||
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
|
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue