Преглед на файлове

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

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:'',
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>


Зареждане…
Отказ
Запис