操作步骤:
执行命令:npm run echarts -s 并回车

看到这样的提示代表安装成功 PS:网络不好的情况建议用cnpm淘宝镜像(全局终端执行命令:npm i -g cnpm --registry=https://registry.npm.taobao.org)

下载china.js
链接: https://pan.baidu.com/s/1EODVh9tJNEbFebbrhKyd_Q 提取码: gjz4
引入
import echarts from 'echarts/lib/echarts'; import '@/map/china.js';
写一个echarts容器 绑定ref
配置option (有必要的注释都已标记)
初始化echarts就可以了
this.myEchart = echarts.init(this.$refs.myEchart); this.myEchart.setOption(option);