允许echart在组件内更换图标类型

This commit is contained in:
aixianling
2024-03-25 17:49:57 +08:00
parent 4c220621b5
commit 5273f300ea
4 changed files with 27 additions and 9 deletions

View File

@@ -14,6 +14,14 @@ export default {
fullscreen: false
}
},
watch: {
value(v) {
const content = this.editor.get()
if (v && content && JSON.stringify(v) != JSON.stringify(content)) {
this.editor?.set(v)
}
}
},
methods: {
init() {
const {JSONEditor} = window
@@ -27,7 +35,7 @@ export default {
},
}, this.value)
} else setTimeout(() => this.init(), 500)
const fullscreenBtn = document.querySelector(".fullscreenBtn")
const fullscreenBtn = this.$el.querySelector(".fullscreenBtn")
if (!fullscreenBtn) {
const btn = document.createElement("div")
btn.className = "fullscreenBtn el-icon-full-screen"