From d4e5ea261895867f92d46b589e574549d40c809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Wed, 28 Jun 2023 15:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=9D=83=E4=BA=A4=E6=98=93=E7=A6=BB?= =?UTF-8?q?=E5=BC=80=E9=A1=B5=E9=9D=A2=E6=97=B6=E6=B8=85=E9=99=A4=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/projectDetail.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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() } };