diff --git a/src/views/project/projectDetail.vue b/src/views/project/projectDetail.vue index 5a0614ae..33a8566a 100644 --- a/src/views/project/projectDetail.vue +++ b/src/views/project/projectDetail.vue @@ -286,7 +286,8 @@ export default { timeConfig:'', biddinglistInformationLength:0, biddingTimeType:0, - isFirst:'' + isFirst:'', + timer:null }; }, computed: { @@ -509,8 +510,7 @@ export default { }) }) - setInterval(function () { - console.log('qweasd') + this.timer = setInterval(function () { getBiddingList(that.id).then(response =>{ that.biddinglistInformation = response.rows if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){ @@ -839,6 +839,19 @@ export default { } } + }, + destroyed () { + console.log('bbbbbbbbbb') + clearInterval(this.timer); + }, + beforeDestory() { + clearInterval(this.timer) + }, + //离开页面清除定时器失效问题 + beforeRouteLeave (to, from, next) { + console.log("我离开了") + clearInterval(this.timer) + next() } };