Skip to content

Commit 89b2eb0

Browse files
committed
build: post merge fixes
1 parent 80f3f2c commit 89b2eb0

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

components/vue3/src/components/vue-particles.vue

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div :id="id"></div>
2+
<div :id="id"></div>
33
</template>
44

55
<script setup lang="ts">
@@ -11,66 +11,66 @@ export type IParticlesProps = ISourceOptions;
1111
let container: Container | undefined, engine: Engine | undefined;
1212
1313
const props = defineProps<{
14-
id: string;
15-
options?: IParticlesProps;
16-
url?: string;
17-
theme?: string;
14+
id: string;
15+
options?: IParticlesProps;
16+
url?: string;
17+
theme?: string;
1818
}>();
1919
2020
const emit = defineEmits<{
21-
(e: "particlesLoaded", container?: Container): void;
21+
(e: "particlesLoaded", container?: Container): void;
2222
}>();
2323
2424
const initEventHandler = (e: Event) => {
25-
const evt = e as CustomEvent<Engine>;
25+
const evt = e as CustomEvent<Engine>;
2626
27-
engine = evt.detail;
27+
engine = evt.detail;
2828
29-
loadParticles();
29+
loadParticles();
3030
};
3131
3232
addEventListener("particlesInit", initEventHandler);
3333
3434
const loadParticles = async () => {
35-
if (!engine) {
36-
engine = tsParticles;
37-
}
35+
if (!engine) {
36+
engine = tsParticles;
37+
}
3838
39-
container = await engine.load({
40-
id: props.id,
41-
url: props.url,
42-
options: props.options,
43-
});
39+
container = await engine.load({
40+
id: props.id,
41+
url: props.url,
42+
options: props.options,
43+
});
4444
45-
emit("particlesLoaded", container);
45+
emit("particlesLoaded", container);
4646
};
4747
4848
onMounted(() => {
49-
nextTick(() => {
50-
if (!props.id) {
51-
throw new Error("Prop 'id' is required!");
52-
}
49+
nextTick(() => {
50+
if (!props.id) {
51+
throw new Error("Prop 'id' is required!");
52+
}
5353
54-
loadParticles();
55-
});
54+
loadParticles();
55+
});
5656
});
5757
5858
onUnmounted(() => {
59-
if (!container) {
60-
return;
61-
}
59+
if (!container) {
60+
return;
61+
}
6262
63-
container.destroy();
63+
container.destroy();
6464
65-
container = undefined;
65+
container = undefined;
6666
67-
removeEventListener("particlesInit", initEventHandler);
67+
removeEventListener("particlesInit", initEventHandler);
6868
});
6969
7070
watch(
7171
() => props.theme,
7272
() => {
73-
container?.loadTheme(props.theme);
73+
container?.loadTheme(props.theme);
7474
},
7575
{ immediate: true, deep: true },
7676
);

0 commit comments

Comments
 (0)