refactor: 修改 Header 上注册事件的方式
This commit is contained in:
parent
5b750fe55f
commit
ec931d038c
|
@ -87,13 +87,17 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
registerEvents() {
|
||||
ApiEvent.$on(LIST_CHANGE, () => {
|
||||
this.$refs.projectRecent.recent();
|
||||
this.$refs.testRecent.recent();
|
||||
this.$refs.reportRecent.recent();
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let self = this;
|
||||
ApiEvent.$on(LIST_CHANGE, () => {
|
||||
self.$refs.projectRecent.recent();
|
||||
self.$refs.testRecent.recent();
|
||||
self.$refs.reportRecent.recent();
|
||||
});
|
||||
this.registerEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,13 +95,17 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
registerEvents() {
|
||||
PerformanceEvent.$on(LIST_CHANGE, () => {
|
||||
this.$refs.projectRecent.recent();
|
||||
this.$refs.testRecent.recent();
|
||||
this.$refs.reportRecent.recent();
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let self = this;
|
||||
PerformanceEvent.$on(LIST_CHANGE, () => {
|
||||
self.$refs.projectRecent.recent();
|
||||
self.$refs.testRecent.recent();
|
||||
self.$refs.reportRecent.recent();
|
||||
});
|
||||
this.registerEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,12 +100,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
let self = this;
|
||||
TrackEvent.$on(LIST_CHANGE, () => {
|
||||
self.$refs.projectRecent.recent();
|
||||
self.$refs.planRecent.recent();
|
||||
self.$refs.caseRecent.recent();
|
||||
});
|
||||
this.registerEvents();
|
||||
},
|
||||
methods: {
|
||||
reload() {
|
||||
|
@ -132,6 +127,13 @@ export default {
|
|||
this.testCaseEditPath = path;
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
registerEvents() {
|
||||
TrackEvent.$on(LIST_CHANGE, () => {
|
||||
this.$refs.projectRecent.recent();
|
||||
this.$refs.planRecent.recent();
|
||||
this.$refs.caseRecent.recent();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue