vue定时请求接口
data() {return {times: null,};},created() {this.getErrorLogDataFun();this.times = setInterval(() => {this.getErrorLogDataFun();}, 1000 * 60);},methods: {getErrorLogDataFun() {//请求XXXXXX}}.
·
页面定时刷新接口分为这几步:
data() {
return {
times: null,
};
},
created() {
this.getErrorLogDataFun();
this.times = setInterval(() => {
this.getErrorLogDataFun();
}, 1000 * 60);
},
methods: {
getErrorLogDataFun() {
//请求XXXXXX
}
}
destroyed() {//销毁
clearInterval(this.times);
},
更多推荐
已为社区贡献2条内容
所有评论(0)