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

解决:

在初始化myCharts = this.$echarts.init(this.$refs.myCharts);打断点

发现this.$echarts为undefined,

怀疑引入依赖问题,

检查项目package.json发现已引入,

最后更换 eCharts 的版本解决,怀疑可能是echarts最新版本问题。

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

 

"echarts": "^5.0.0", // 替换为4.8.0
npm install echarts@4.8.0 --save

 

更多推荐