vue echarts 定时器 重新加载图表
部分代码块
data(){
return{
echarts:null,
}
},
mounted(){
this.getData();
},
methods:{
getData(){
this.echarts= this.$echarts.init(doument.getElementById("div的id"));
cont option={
//此处神略 echarts 配置参数
}
//clear 清空
echarts.clear();
echarts.setOption(option);
},
timer(){
return setTimeout(()=>{
this.getData();
},10000)
}
},
watch:{
echarts(){
//调用定时器
this.timer();
}
}