把 _this.myChart.resize() 改为 if (_this.myChart) _this.myChart.resize(); 就可以了。
window.addEventListener("resize", function () { // _this.myChart.resize(); // y原先的写法图表自适应的一个方法 if (_this.myChart) _this.myChart.resize(); //现在的写法 });
vue使用echarts自适应报错 Uncaught TypeError: Cannot read property ‘resize‘ of undefined
最新推荐文章于 2024-07-23 21:45:00 发布