瀏覽代碼

产权交易离开页面时清除定时器

rongxin_prod
庞东旭 1 年之前
父節點
當前提交
d4e5ea2618
共有 1 個檔案被更改,包括 16 行新增3 行删除
  1. +16
    -3
      src/views/project/projectDetail.vue

+ 16
- 3
src/views/project/projectDetail.vue 查看文件

@@ -286,7 +286,8 @@ export default {
timeConfig:'', timeConfig:'',
biddinglistInformationLength:0, biddinglistInformationLength:0,
biddingTimeType:0, biddingTimeType:0,
isFirst:''
isFirst:'',
timer:null
}; };
}, },
computed: { computed: {
@@ -509,8 +510,7 @@ export default {
}) })
}) })


setInterval(function () {
console.log('qweasd')
this.timer = setInterval(function () {
getBiddingList(that.id).then(response =>{ getBiddingList(that.id).then(response =>{
that.biddinglistInformation = response.rows that.biddinglistInformation = response.rows
if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){ 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()
} }
}; };
</script> </script>


Loading…
取消
儲存