flex: echarts resize 方法

This commit is contained in:
@changcode
2022-07-14 17:15:34 +08:00
parent c367966e04
commit 381a4e1a66
2 changed files with 9 additions and 1 deletions

View File

@@ -61,12 +61,17 @@ export default {
this.chartOption2.series[0].data = this.chartData2
this.myChart2.setOption(pieChartOption2)
}
},
resize () {
this.myChart.resize()
this.myChart2.resize()
}
},
mounted () {
this.timer = setTimeout(() => {
this.init()
}, 100)
window.addEventListener('resize', this.resize)
},
beforeUnmount () {
clearTimeout(this.timer)