echart报错: Component series.map3D not exists. Load it first和Cannot read property 'features' of null
这个问题让我崩溃了一会儿,在百度上查的问题几乎和这个没有关系,最后还是解决了
1.Component series.map3D not exists. Load it first
这个问题我出错的原因是没有安装echarts-gl
npm install echarts-gl
然后在main.js中引入
import echartsGL from ‘echarts-gl’ // 引入echarts
Vue.prototype.$echartsGL = echartsGL // 引入组件(将echarts注册为全局)
然后报错就没有了,接下来是
Cannot read property ‘features’ of null
原因是没有引入world.js
import world from ‘echarts/map/js/world.js’
引入之后就出来了
效果图