Skip to content

Commit c49ca9f

Browse files
committed
feat: updated for v3
1 parent a167190 commit c49ca9f

24 files changed

+3733
-3145
lines changed

apps/nuxt3/app.vue

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
<template>
22
<div>
3-
<NuxtWelcome />
4-
<vue-particles
5-
id="tsparticles"
6-
:options="options"
7-
:particles-init="particlesInit"
8-
@particles-loaded="particlesLoaded"
9-
/>
3+
<!--<NuxtWelcome/>-->
4+
<client-only>
5+
<vue-particles
6+
id="tsparticles"
7+
:options="options"
8+
@particles-loaded="particlesLoaded"
9+
/>
10+
</client-only>
1011
</div>
1112
</template>
1213
<script setup lang="ts">
13-
import { loadFull } from "tsparticles";
14-
import type { ISourceOptions, Container } from "tsparticles-engine";
14+
import type { ISourceOptions, Container } from "@tsparticles/engine";
1515
1616
const options: ISourceOptions = {
1717
background: {
18-
color: "#fff"
19-
},
20-
fullScreen: {
21-
enable: true,
22-
zIndex: -1
18+
color: "#000"
2319
},
2420
particles: {
25-
color: {
26-
value: "#000"
27-
},
2821
links: {
29-
color: "#000",
3022
enable: true
3123
},
3224
move: {
@@ -38,11 +30,7 @@ const options: ISourceOptions = {
3830
}
3931
}
4032
41-
const particlesInit = async (engine) => {
42-
await loadFull(engine)
43-
}
44-
45-
const particlesLoaded = (container: Container) => {
33+
const particlesLoaded = (container?: Container) => {
4634
console.log(container)
4735
}
4836

apps/nuxt3/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@
1717
"*.**": "prettier --check --ignore-unknown"
1818
},
1919
"dependencies": {
20-
"@babel/core": "^7.22.9",
21-
"@babel/eslint-parser": "^7.22.9",
20+
"@babel/core": "^7.23.5",
21+
"@babel/eslint-parser": "^7.23.3",
2222
"@nuxt/ui-templates": "^1.3.1",
2323
"@nuxtjs/eslint-config": "^12.0.0",
2424
"@nuxtjs/eslint-module": "^4.1.0",
25-
"@vue/reactivity": "^3.3.4",
26-
"@vue/runtime-core": "^3.3.4",
27-
"@vue/runtime-dom": "^3.3.4",
28-
"@vue/shared": "^3.3.4",
25+
"@vue/reactivity": "^3.3.11",
26+
"@vue/runtime-core": "^3.3.11",
27+
"@vue/runtime-dom": "^3.3.11",
28+
"@vue/shared": "^3.3.11",
2929
"consola": "^3.2.3",
30-
"eslint": "^8.46.0",
31-
"eslint-config-prettier": "^9.0.0",
30+
"eslint": "^8.55.0",
31+
"eslint-config-prettier": "^9.1.0",
3232
"eslint-plugin-nuxt": "^4.0.0",
33-
"eslint-plugin-vue": "^9.16.1",
34-
"lint-staged": "^14.0.0",
35-
"nuxt": "^3.6.5",
36-
"prettier": "^3.0.1",
37-
"tsparticles": "^2.12.0",
38-
"tsparticles-engine": "^2.12.0",
39-
"typescript": "^5.1.6",
40-
"vue": "^3.3.4",
41-
"vue3-particles": "workspace:^",
42-
"webpack": "^5.88.2"
33+
"eslint-plugin-vue": "^9.19.2",
34+
"lint-staged": "^15.2.0",
35+
"nuxt": "^3.8.2",
36+
"prettier": "^3.1.1",
37+
"tsparticles": "^3.0.2",
38+
"@tsparticles/engine": "^3.0.2",
39+
"typescript": "^5.3.3",
40+
"vue": "^3.3.11",
41+
"@tsparticles/vue3": "workspace:^",
42+
"webpack": "^5.89.0"
4343
}
4444
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import Particles from 'vue3-particles'
1+
import Particles from '@tsparticles/vue3'
2+
import { loadFull } from "tsparticles";
3+
import { defineNuxtPlugin } from "#app";
24

35
export default defineNuxtPlugin((nuxtApp) => {
4-
// Doing something with nuxtApp
5-
nuxtApp.vueApp.use(Particles)
6+
// Doing something with nuxtApp
7+
nuxtApp.vueApp.use(Particles, {
8+
init: async (engine) => {
9+
await loadFull(engine);
10+
}
11+
})
612
})

apps/vue3/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@
1212
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
1313
},
1414
"dependencies": {
15-
"tsparticles": "^2.12.0",
16-
"tsparticles-demo-configs": "^2.12.0",
17-
"tsparticles-engine": "^2.12.0",
18-
"vue": "^3.3.4",
19-
"vue-router": "^4.2.4",
20-
"vue3-particles": "workspace:^"
15+
"tsparticles": "^3.0.2",
16+
"@tsparticles/configs": "^3.0.2",
17+
"@tsparticles/engine": "^3.0.2",
18+
"vue": "^3.3.11",
19+
"vue-router": "^4.2.5",
20+
"@tsparticles/vue3": "workspace:^"
2121
},
2222
"devDependencies": {
23-
"@rushstack/eslint-patch": "^1.3.2",
24-
"@tsconfig/node18": "^18.2.0",
25-
"@types/node": "^20.4.7",
26-
"@vitejs/plugin-vue": "^4.2.3",
27-
"@vitejs/plugin-vue-jsx": "^3.0.1",
23+
"@rushstack/eslint-patch": "^1.6.0",
24+
"@tsconfig/node18": "^18.2.2",
25+
"@types/node": "^20.10.4",
26+
"@vitejs/plugin-vue": "^4.5.2",
27+
"@vitejs/plugin-vue-jsx": "^3.1.0",
2828
"@vue/eslint-config-prettier": "^8.0.0",
29-
"@vue/eslint-config-typescript": "^11.0.3",
29+
"@vue/eslint-config-typescript": "^12.0.0",
3030
"@vue/tsconfig": "^0.4.0",
31-
"eslint": "^8.46.0",
32-
"eslint-plugin-vue": "^9.16.1",
31+
"eslint": "^8.55.0",
32+
"eslint-plugin-vue": "^9.19.2",
3333
"minimatch": "^9.0.3",
3434
"npm-run-all": "^4.1.5",
35-
"prettier": "^3.0.1",
36-
"typescript": "^5.1.6",
37-
"vite": "^4.4.8",
38-
"vue-tsc": "^1.8.8"
35+
"prettier": "^3.1.1",
36+
"typescript": "^5.3.3",
37+
"vite": "^5.0.7",
38+
"vue-tsc": "^1.8.25"
3939
}
4040
}

apps/vue3/src/App.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<script setup lang="ts">
2-
import type { Container, Engine } from "tsparticles-engine";
3-
import { loadFull } from "tsparticles";
4-
import configs from "tsparticles-demo-configs";
2+
import type { Container } from "@tsparticles/engine";
3+
import configs from "@tsparticles/configs";
54
65
const options = configs.basic;
76
8-
const particlesInit = async (engine: Engine) => {
9-
await loadFull(engine);
10-
};
11-
127
const particlesLoaded = async (container: Container) => {
138
console.log(container);
149
};
@@ -19,7 +14,6 @@ const particlesLoaded = async (container: Container) => {
1914
<vue-particles
2015
id="tsparticles"
2116
:options="options"
22-
:particles-init="particlesInit"
2317
@particles-loaded="particlesLoaded"
2418
/>
2519
</main>

apps/vue3/src/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { createApp } from "vue";
2-
import Particles from "vue3-particles";
2+
import Particles from "@tsparticles/vue3";
33
import App from "./App.vue";
44

55
import "./assets/main.css";
6+
import { loadFull } from "tsparticles";
7+
import type { Engine } from "@tsparticles/engine";
68

79
const app = createApp(App);
810

9-
app.use(Particles);
11+
app.use(Particles, {
12+
init: async (engine: Engine) => {
13+
await loadFull(engine);
14+
}
15+
});
1016

1117
app.mount("#app");

components/vue3-alt/.eslintrc.cjs

Lines changed: 0 additions & 15 deletions
This file was deleted.

components/vue3-alt/.gitignore

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)