处理切换页面之后,有效率数据的定时器没有销毁的问题

This commit is contained in:
renpy 2023-09-05 18:15:10 +08:00
parent 08b707d45b
commit ff4133f84a

View File

@ -185,6 +185,8 @@ export default {
handler:function(val,oldVal) {
if (val.name!=="station-operation") {
this.$message.destroy()
clearInterval(this.timer);
this.timer = null
}
},
deep:true,
@ -233,7 +235,7 @@ export default {
this.getStationTypeList()
this.getStationTree()
},
destroyed () {
beforeDestroy () {
clearInterval(this.timer);
this.timer = null
},