forked from github/dataease
commit
8130b56f9a
@ -47,13 +47,15 @@ export default {
|
|||||||
// window.SyncComponentCache[this.url] = Axios.get(this.url)
|
// window.SyncComponentCache[this.url] = Axios.get(this.url)
|
||||||
res = await window.SyncComponentCache[this.url]
|
res = await window.SyncComponentCache[this.url]
|
||||||
} else {
|
} else {
|
||||||
res = await window.SyncComponentCache[this.url]
|
this.mode = await window.SyncComponentCache[this.url]
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
const Fn = Function
|
const Fn = Function
|
||||||
const dynamicCode = res.data || res
|
const dynamicCode = res.data || res
|
||||||
const component = new Fn(`return ${dynamicCode}`)()
|
const component = new Fn(`return ${dynamicCode}`)()
|
||||||
this.mode = component.default || component
|
this.mode = component.default || component
|
||||||
|
window.SyncComponentCache[this.url] = this.mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,6 +63,9 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.refId = uuid.v1
|
this.refId = uuid.v1
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.mode = null
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/* chartResize() {
|
/* chartResize() {
|
||||||
this.$refs[this.refId] && this.$refs[this.refId].chartResize && this.$refs[this.refId].chartResize()
|
this.$refs[this.refId] && this.$refs[this.refId].chartResize && this.$refs[this.refId].chartResize()
|
||||||
|
Loading…
Reference in New Issue
Block a user