perf(视图): 减少重绘
This commit is contained in:
parent
0f11bea251
commit
74094579fb
@ -145,7 +145,8 @@ export default {
|
|||||||
'line-stack',
|
'line-stack',
|
||||||
'scatter'
|
'scatter'
|
||||||
],
|
],
|
||||||
resizeTimer: null
|
resizeTimer: null,
|
||||||
|
renderTimer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -499,7 +500,11 @@ export default {
|
|||||||
// 指定图表的配置项和数据
|
// 指定图表的配置项和数据
|
||||||
const chart = this.myChart
|
const chart = this.myChart
|
||||||
this.setBackGroundBorder()
|
this.setBackGroundBorder()
|
||||||
setTimeout(chart.setOption(option, true), 500)
|
this.renderTimer && clearTimeout(this.renderTimer)
|
||||||
|
this.renderTimer = setTimeout(() => {
|
||||||
|
chart.clear()
|
||||||
|
chart.setOption(option, true)
|
||||||
|
}, 500)
|
||||||
window.removeEventListener('resize', chart.resize)
|
window.removeEventListener('resize', chart.resize)
|
||||||
},
|
},
|
||||||
setBackGroundBorder() {
|
setBackGroundBorder() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user