Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

echarts的resize不生效问题

vue中,使用封装的echarts组件自适应容器,全都是百分比+flex布局,结果容器缩放时,echarts不resize,其实已经调了resize方法了;

求助各位大神怎么解决


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
window.addEventListener("resize", () => {
    chartIns.resize()
}, false);

最好 用节流函数 控制一下


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...