fix: 修复菜单组件会重复监听事件的问题
This commit is contained in:
parent
b9b95d63d8
commit
ad597dcd79
|
@ -97,7 +97,6 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
ApiEvent.$on(LIST_CHANGE, () => {
|
ApiEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
});
|
});
|
||||||
|
@ -111,6 +110,9 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.registerEvents();
|
this.registerEvents();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
ApiEvent.$off(LIST_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,6 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
PerformanceEvent.$on(LIST_CHANGE, () => {
|
PerformanceEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
|
||||||
this.$refs.testRecent.recent();
|
this.$refs.testRecent.recent();
|
||||||
this.$refs.reportRecent.recent();
|
this.$refs.reportRecent.recent();
|
||||||
});
|
});
|
||||||
|
@ -92,6 +91,9 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.registerEvents();
|
this.registerEvents();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
PerformanceEvent.$off(LIST_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,13 @@ export default {
|
||||||
},
|
},
|
||||||
registerEvents() {
|
registerEvents() {
|
||||||
TrackEvent.$on(LIST_CHANGE, () => {
|
TrackEvent.$on(LIST_CHANGE, () => {
|
||||||
// // todo 这里偶尔会有 refs 为空的情况
|
|
||||||
this.$refs.planRecent.recent();
|
this.$refs.planRecent.recent();
|
||||||
this.$refs.caseRecent.recent();
|
this.$refs.caseRecent.recent();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
TrackEvent.$off(LIST_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue