1. 程式人生 > >在vue中使用echarts,親自操作配置步驟

在vue中使用echarts,親自操作配置步驟

1.在main.js中寫:
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

2.在要匯入echarts的頁面中新增一個全域性變數。


3.在mounted(){}中新增echarts的程式碼。

4.在上面的h5程式碼中寫一個div,id名稱要與init中的document.getElementbyid('')一致。