1:工程添加echarts,
npm install echarts --save
yarn add echarts --save
2:在main.js中引入echarts
import echarts from 'echarts'
3:需要註冊百度地圖API的密匙;
4:在index.html中全局引用
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=這裏是祕鑰"></script>
5:地圖右下角有說明
在index.html中引入如下代碼
<style>
.BMap_cpyCtrl {
display: none;
}
.anchorBL {
display: none;
}
</style>
6:然後按照echart例子就可以顯示出來了
例子地址:https://echarts.baidu.com/examples/editor.html?c=map-polygon