一、echarts
// 在mainjs中添加
// 引入echarts
import echarts from 'echarts';
Object.defineProperties(Vue.prototype, {
echarts: { get: () => echarts }
});
// 在相应的页面
this.myChart = this.echarts.init(document.getElementById('myChart'))
二、highcharts
// 引入HighCharts
import HighCharts from 'highcharts';
// 使用highcharts
Vue.prototype.$HighCharts = HighCharts;
self.$HighCharts.chart('myChart', {})