Skip to content

Commit 6e00c48

Browse files
committed
Merge branch 'main' into dev
2 parents 27afa84 + 8ca5ebb commit 6e00c48

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/setup-node@v4
3232
with:
3333
node-version: '16'
34-
- uses: pnpm/action-setup@v2.4.0
34+
- uses: pnpm/action-setup@v3.0.0
3535
name: Install pnpm
3636
id: pnpm-install
3737
with:
@@ -73,7 +73,7 @@ jobs:
7373
- uses: actions/setup-node@v4
7474
with:
7575
node-version: '16'
76-
- uses: pnpm/action-setup@v2.4.0
76+
- uses: pnpm/action-setup@v3.0.0
7777
name: Install pnpm
7878
id: pnpm-install
7979
with:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ yarn add @tsparticles/vue3
2121
```javascript
2222
import Particles from "@tsparticles/vue3";
2323
//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
24-
import { loadSlim } from "tsparticles-slim"; // if you are going to use `loadSlim`, install the "tsparticles-slim" package too.
24+
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
2525

2626
createApp(App).use(Particles, {
2727
init: async engine => {
2828
// await loadFull(engine); // you can load the full tsParticles library from "tsparticles" if you need it
29-
await loadSlim(engine); // or you can load the slim version from "tsparticles-slim" if don't need Shapes or Animations
29+
await loadSlim(engine); // or you can load the slim version from "@tsparticles/slim" if don't need Shapes or Animations
3030
},
3131
});
3232
```

apps/nuxt3/.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@master
2525

2626
- name: Setup node env 🏗
27-
uses: actions/setup-node@v3.5.1
27+
uses: actions/setup-node@v4.0.1
2828
with:
2929
node-version: ${{ matrix.node }}
3030
check-latest: true
@@ -34,7 +34,7 @@ jobs:
3434
run: echo "::set-output name=dir::$(yarn cache dir)"
3535

3636
- name: Cache node_modules 📦
37-
uses: actions/cache@v3.2.2
37+
uses: actions/cache@v3.3.3
3838
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3939
with:
4040
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

components/vue3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ yarn add @tsparticles/vue3
2121
```javascript
2222
import Particles from "@tsparticles/vue3";
2323
//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
24-
import { loadSlim } from "tsparticles-slim"; // if you are going to use `loadSlim`, install the "tsparticles-slim" package too.
24+
import { loadSlim } from "@tsparticles/slim"; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
2525

2626
createApp(App).use(Particles, {
2727
init: async engine => {
2828
// await loadFull(engine); // you can load the full tsParticles library from "tsparticles" if you need it
29-
await loadSlim(engine); // or you can load the slim version from "tsparticles-slim" if don't need Shapes or Animations
29+
await loadSlim(engine); // or you can load the slim version from "@tsparticles/slim" if don't need Shapes or Animations
3030
},
3131
});
3232
```

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<script setup lang="ts">
66
import { type Container, type ISourceOptions, type Engine, tsParticles } from "@tsparticles/engine";
7-
import { nextTick, onMounted, onUnmounted } from "vue";
7+
import { nextTick, onMounted, onUnmounted, watch } from "vue";
88
99
export type IParticlesProps = ISourceOptions;
1010
@@ -14,19 +14,22 @@ const props = defineProps<{
1414
id: string;
1515
options?: IParticlesProps;
1616
url?: string;
17+
theme?: string;
1718
}>();
1819
1920
const emit = defineEmits<{
2021
(e: "particlesLoaded", container?: Container): void;
2122
}>();
2223
23-
addEventListener("particlesInit", (e: Event) => {
24+
const initEventHandler = (e: Event) => {
2425
const evt = e as CustomEvent<Engine>;
2526
2627
engine = evt.detail;
2728
2829
loadParticles();
29-
});
30+
};
31+
32+
addEventListener("particlesInit", initEventHandler);
3033
3134
const loadParticles = async () => {
3235
if (!engine) {
@@ -60,5 +63,15 @@ onUnmounted(() => {
6063
container.destroy();
6164
6265
container = undefined;
66+
67+
removeEventListener("particlesInit", initEventHandler);
6368
});
69+
70+
watch(
71+
() => props.theme,
72+
() => {
73+
container?.loadTheme(props.theme);
74+
},
75+
{ immediate: true, deep: true },
76+
);
6477
</script>

0 commit comments

Comments
 (0)