feat: 新增销毁函数
This commit is contained in:
@@ -48,6 +48,10 @@ export default {
|
|||||||
this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
|
this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
|
||||||
this.initChart();
|
this.initChart();
|
||||||
},
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
this.chart.dispose()
|
||||||
|
this.chart = null
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart () {
|
initChart () {
|
||||||
// 初始化echart
|
// 初始化echart
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
calcRate () {
|
calcRate () {
|
||||||
const appRef = this.$refs["appRef"]
|
const appRef = this.$refs["appRef"]
|
||||||
console.log(appRef)
|
|
||||||
if (!appRef) return
|
if (!appRef) return
|
||||||
// 当前宽高比
|
// 当前宽高比
|
||||||
const currentRate = parseFloat((window.innerWidth / window.innerHeight).toFixed(5))
|
const currentRate = parseFloat((window.innerWidth / window.innerHeight).toFixed(5))
|
||||||
|
|||||||
Reference in New Issue
Block a user