优化首页定时器调整5分钟更新一次。

master
kevin jiang 6 years ago
parent 4b08de8a5c
commit f2dbe98c4f

@ -240,6 +240,7 @@
{'date': '1/1', '新增好友': 30, '新增好友(去重)': 25},
]
},
timer: null
}
},
computed: {
@ -273,9 +274,11 @@
this.dateBtnClick('今日');
this.timingRefresh();
},
destroyed: function(){
//
clearInterval(this.intervalId);
//
beforeDestroy() {
if (this.timer){
clearInterval(this.timer);
}
},
methods: {
//
@ -509,10 +512,9 @@
//
timingRefresh: function () {
let that = this;
let intervalId = setInterval(function () {
that.timer = setInterval(function () {
that.dateBtnClick(that.dateBtnValue);
}, 1000 * 60);
this.intervalId = intervalId;
}, 1000 * 60 * 5);
}
}

Loading…
Cancel
Save