vue 中引用echarts 初始化init undefind问题(Cannot read property ‘init‘ of undefined)

vue 中引用echarts时 居然报Init为未定义

Cannot read property 'init' of undefined"

开始认为是 引入 或者 加载顺序 有问题,结果发现都不是,后来想着是不是版本有问题,结果它来了!!!

查看echarts版本:

npm view echarts versions

因为 默认安装包是安装最新 的版本的。我就选择用前一个4.8.0试试。

首先卸载echarts:

npm uninstall echarts --save

安装4.8.0版本:(@后面是指定想安装 的版本号)

npm install echarts@4.8.0 --save

安装之后问题解决!!!
posted @ 2021-01-16 16:26  隔壁老于头  阅读(2666)  评论(0编辑  收藏  举报