Add emitter.off cleanup in onBeforeUnmount for 10 components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user