feat: 新增销毁函数

This commit is contained in:
MTrun
2021-11-08 13:02:22 +08:00
parent 6346d04394
commit 87bc0602bf
2 changed files with 4 additions and 1 deletions
+4
View File
@@ -48,6 +48,10 @@ export default {
this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
this.initChart();
},
beforeDestroy () {
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
// 初始化echart
-1
View File
@@ -30,7 +30,6 @@ export default {
methods: {
calcRate () {
const appRef = this.$refs["appRef"]
console.log(appRef)
if (!appRef) return
// 当前宽高比
const currentRate = parseFloat((window.innerWidth / window.innerHeight).toFixed(5))