Commit 06478b04 by Kyle_Li

fix:定时器离开未取消

parent 5c3ff1dd
......@@ -291,6 +291,7 @@ export default {
// this.$nextTick(_ => {
this.$store.commit("mutations-slide", true);
// });
this.getProcessList();
},
methods: {
// 父组件调用子组件方法,触发父组件事件
......@@ -1048,6 +1049,12 @@ export default {
? sessionStorage.getItem("poscurrentPage")
: 1;
this.getEnterpriseInfo();
this.$on('hook:deactivated', _ => {
if(this.timer) clearInterval(this.timer);
})
this.$on('hook:beforeDestroy', _ => {
if(this.timer) clearInterval(this.timer);
})
},
beforeMount() {
this.getAjaxMembers();
......
......@@ -1052,9 +1052,6 @@ export default {
this.$store.commit("mutations-slide", true);
});
},
deactivated() {
if(this.timer) clearInterval(this.timer);
},
created() {
if (!this.storeImageUrl) {
this.$store.dispatch("getStorePicture");
......@@ -1064,6 +1061,12 @@ export default {
this.initialize();
this.getAjaxMembers();
this.getGradeList();
this.$on('hook:deactivated', _ => {
if(this.timer) clearInterval(this.timer);
})
this.$on('hook:beforeDestroy', _ => {
if(this.timer) clearInterval(this.timer);
})
},
components: {
searchinput,
......
......@@ -198,7 +198,7 @@ export default {
} else {
let self = this;
clearTimeout(self.timer);
this.timer = setTimeout(() => {
this.timer = setInterval(() => {
this.getProcessList();
}, 5000);
}
......@@ -983,6 +983,7 @@ export default {
// this.$nextTick(_ => {
this.$store.commit("mutations-slide", true);
// });
this.getProcessList();
},
created() {
this.fieldList();
......@@ -994,6 +995,12 @@ export default {
this.initialize();
this.getAjaxMembers();
this.getGradeList();
this.$on('hook:deactivated', _ => {
if(this.timer) clearInterval(this.timer);
})
this.$on('hook:beforeDestroy', _ => {
if(this.timer) clearInterval(this.timer);
})
},
components: {
searchinput,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment