Merge pull request #5581 from dataease/pr@dev_st_fix

Pr@dev st fix
This commit is contained in:
dataeaseShu 2023-07-05 11:56:14 +08:00 committed by GitHub
commit 8130b56f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,13 +47,15 @@ export default {
// window.SyncComponentCache[this.url] = Axios.get(this.url)
res = await window.SyncComponentCache[this.url]
} else {
res = await window.SyncComponentCache[this.url]
this.mode = await window.SyncComponentCache[this.url]
return
}
if (res) {
const Fn = Function
const dynamicCode = res.data || res
const component = new Fn(`return ${dynamicCode}`)()
this.mode = component.default || component
window.SyncComponentCache[this.url] = this.mode
}
}
}
@ -61,6 +63,9 @@ export default {
created() {
this.refId = uuid.v1
},
beforeDestroy() {
this.mode = null
},
methods: {
/* chartResize() {
this.$refs[this.refId] && this.$refs[this.refId].chartResize && this.$refs[this.refId].chartResize()