Add emitter.off cleanup in onBeforeUnmount for 10 components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 18:04:43 +08:00
parent b023d28b74
commit d3bba9d1a2
10 changed files with 66 additions and 11 deletions

View File

@@ -29,7 +29,7 @@
* matched activities.
*/
import { ref, watch } from "vue";
import { ref, watch, onBeforeUnmount } from "vue";
import emitter from "@/utils/emitter";
const props = defineProps(["data", "select"]);
@@ -51,4 +51,8 @@ watch(
);
emitter.on("reset", (val) => (displayData.value = val));
onBeforeUnmount(() => {
emitter.off("reset");
});
</script>