flex: echarts resize 方法
This commit is contained in:
@@ -5907,7 +5907,6 @@ export default {
|
|||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
this.myChart.setOption(this.chartOption)
|
this.myChart.setOption(this.chartOption)
|
||||||
this.myChart.resize()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
dispatchLegendSelectAction (name) {
|
dispatchLegendSelectAction (name) {
|
||||||
@@ -5954,12 +5953,16 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
resize () {
|
||||||
|
this.myChart.resize()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
this.init()
|
this.init()
|
||||||
}, 100)
|
}, 100)
|
||||||
|
window.addEventListener('resize', this.resize)
|
||||||
},
|
},
|
||||||
beforeUnmount () {
|
beforeUnmount () {
|
||||||
clearTimeout(this.timer)
|
clearTimeout(this.timer)
|
||||||
|
|||||||
@@ -61,12 +61,17 @@ export default {
|
|||||||
this.chartOption2.series[0].data = this.chartData2
|
this.chartOption2.series[0].data = this.chartData2
|
||||||
this.myChart2.setOption(pieChartOption2)
|
this.myChart2.setOption(pieChartOption2)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
resize () {
|
||||||
|
this.myChart.resize()
|
||||||
|
this.myChart2.resize()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
this.init()
|
this.init()
|
||||||
}, 100)
|
}, 100)
|
||||||
|
window.addEventListener('resize', this.resize)
|
||||||
},
|
},
|
||||||
beforeUnmount () {
|
beforeUnmount () {
|
||||||
clearTimeout(this.timer)
|
clearTimeout(this.timer)
|
||||||
|
|||||||
Reference in New Issue
Block a user