vue 引入echarts报错 was not found in 'echarts'

"export 'default' (imported as 'echarts') was not found in 'echarts'

查看安装的是echarts 5.0

页面查看报"TypeError: echarts.init is not a function"错误,

但是console.log()出来的echarts.init就是function。

经测试,echarts for react不支持echarts最新版本5.0.0因此引入4.9.0

最后发现只能执行:

npm install echarts@4.9.0

才可以变更为4.9。使用就没有问题了

你可能感兴趣的:(vue 引入echarts报错 was not found in 'echarts')