Procházet zdrojové kódy

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

rongxin_prod
庞东旭 před 1 rokem
rodič
revize
d4e5ea2618
1 změnil soubory, kde provedl 16 přidání a 3 odebrání
  1. +16
    -3
      src/views/project/projectDetail.vue

+ 16
- 3
src/views/project/projectDetail.vue Zobrazit soubor

@@ -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()
}
};
</script>


Načítá se…
Zrušit
Uložit