mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-10 12:50:38 +08:00
refine
This commit is contained in:
parent
4034a76120
commit
823f45e1fc
@ -16,6 +16,7 @@ import 'codemirror/addon/lint/json-lint'
|
||||
|
||||
export default {
|
||||
name: 'JsonEditor',
|
||||
/* eslint-disable vue/require-prop-types */
|
||||
props: ['value'],
|
||||
data() {
|
||||
return {
|
||||
@ -24,8 +25,8 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value(value) {
|
||||
const editor_value = this.jsonEditor.getValue()
|
||||
if (value !== editor_value) {
|
||||
const editorValue = this.jsonEditor.getValue()
|
||||
if (value !== editorValue) {
|
||||
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user