fix: 修复菜单组件会重复监听事件的问题

This commit is contained in:
shiziyuan9527 2021-01-04 15:44:38 +08:00
parent b9b95d63d8
commit ad597dcd79
3 changed files with 9 additions and 3 deletions

View File

@ -97,7 +97,6 @@ export default {
methods: {
registerEvents() {
ApiEvent.$on(LIST_CHANGE, () => {
// // todo refs
this.$refs.testRecent.recent();
this.$refs.reportRecent.recent();
});
@ -111,6 +110,9 @@ export default {
},
mounted() {
this.registerEvents();
},
beforeDestroy() {
ApiEvent.$off(LIST_CHANGE);
}
}

View File

@ -84,7 +84,6 @@ export default {
methods: {
registerEvents() {
PerformanceEvent.$on(LIST_CHANGE, () => {
// // todo refs
this.$refs.testRecent.recent();
this.$refs.reportRecent.recent();
});
@ -92,6 +91,9 @@ export default {
},
mounted() {
this.registerEvents();
},
beforeDestroy() {
PerformanceEvent.$off(LIST_CHANGE);
}
}

View File

@ -131,11 +131,13 @@ export default {
},
registerEvents() {
TrackEvent.$on(LIST_CHANGE, () => {
// // todo refs
this.$refs.planRecent.recent();
this.$refs.caseRecent.recent();
});
}
},
beforeDestroy() {
TrackEvent.$off(LIST_CHANGE);
}
}