echarts添加加载中效果
// 1、获取div
this.echart = echarts.init(document.getElementById("rate-retention-echart"));
// 2、在调用接口之前,使用shiowLoading()方法
this.echart.showLoading({ text: "",color: "#8870eb" });
// 3、在画完echarts之后,使用hideLoading()方法
this.echart.hideLoading();
<div id="rate-retention-echart"></div>
import * as echarts from "echarts";
this.echart = echarts.init(document.getElementById("rate-retention-echart"));
this.echart.showLoading({ text: "",color: "#8870eb" });
this.echart.setOption({
})
window.addEventListener('resize', () => {
this.echart.resize();
});
this.echart.hideLoading();