安卓IOS微信应该都是没问题的,如果是H5的话,不建议用封装的mpvue-echarts标签,而是使用原本的H5用法,采用预编译,类似
import * as echarts from 'echarts'
// #ifndef H5
import mpvueEcharts from 'mpvue-echarts'
// #endif
...
// #ifdef H5
mounted(){
this.myChart() //函数调用
},
// #endif
method:...
// 初始化
// #ifdef H5
myChart(){
// let el = uni.createSelectorQuery().select('myChart');
let el = document.getElementById(this.myChartId);
let myChart= echarts.init(el);
const option = this.getOption();
myChart.setOption(option);
},
// #endif
// #ifndef H5
onInit(canvas, width, height) {
console.log('onInit(canvas, width, height)');
let myChart = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(myChart);
const option = this.getOption();
myChart.setOption(option);
return myChart;
},