We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8150718 + c90d66f commit 8ca5ebbCopy full SHA for 8ca5ebb
components/vue3/src/components/vue-particles.vue
@@ -21,13 +21,14 @@ const emit = defineEmits<{
21
(e: "particlesLoaded", container?: Container): void;
22
}>();
23
24
-addEventListener("particlesInit", (e: Event) => {
+const initEventHandler = (e: Event) => {
25
const evt = e as CustomEvent<Engine>;
26
27
engine = evt.detail;
28
29
loadParticles();
30
-});
+};
31
+addEventListener("particlesInit", initEventHandler);
32
33
const loadParticles = async () => {
34
if (!engine) {
@@ -57,9 +58,9 @@ onUnmounted(() => {
57
58
if (!container) {
59
return;
60
}
-
61
container.destroy();
62
container = undefined;
63
+ removeEventListener("particlesInit", initEventHandler);
64
});
65
66
watch(
0 commit comments