vue eCharts Cannot read property ‘init‘ of undefined 报错问题

Q:vue eCharts Cannot read property ‘init‘ of undefined 报错问题

A: 初始化myCharts = this.$echarts.init(this.$refs.myCharts);打断点发现this.$echarts为undefined,怀疑引入依赖问题,检查package.json已引入,最后更换 eCharts 的版本解决,可能是最新版本问题。

"echarts": "^5.0.0", // 替换为4.8.0

npm install [email protected] --save

猜你喜欢

转载自blog.csdn.net/zhufan2333/article/details/125916029
今日推荐