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