mounted() {
this.getCharts();
this.conversionOption;
// echarts的初始化进入页面 渲染图表
this.oderFormChart = this.$echarts.init(this.$refs.main);
this.oderFormChart.setOption(this.oderFormOption, true);
//自适应页面宽度
window.onresize = () => {
//添加需要自适应的图表
this.oderFormChart.resize();
this.conversionChart.resize();
};
},
在mounted中自适应