Add event listener cleanup to prevent memory leaks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
* scrollable display of check results.
|
||||
*/
|
||||
|
||||
import { reactive, computed } from 'vue';
|
||||
import { reactive, computed, onBeforeUnmount } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useConformanceStore } from '@/stores/conformance';
|
||||
import emitter from '@/utils/emitter';
|
||||
@@ -265,6 +265,17 @@ emitter.on('isRadioActSeqMoreChange', (data) => {
|
||||
emitter.on('isRadioActSeqFromToChange', (data) => {
|
||||
if(data) reset();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
emitter.off('actListData');
|
||||
emitter.off('actRadioData');
|
||||
emitter.off('getListSequence');
|
||||
emitter.off('reset');
|
||||
emitter.off('isRadioChange');
|
||||
emitter.off('isRadioProcessScopeChange');
|
||||
emitter.off('isRadioActSeqMoreChange');
|
||||
emitter.off('isRadioActSeqFromToChange');
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
:deep(.disc) {
|
||||
|
||||
Reference in New Issue
Block a user