22
33# @tsparticles/vue2
44
5- [ ![ npm] ( https://img.shields.io/npm/v/@tsparticles/vue )] ( https://www.npmjs.com/package/@tsparticles/vue ) [ ![ npm] ( https://img.shields.io/npm/dm/vue2-particles )] ( https://www.npmjs.com/package/vue2-particles ) [ ![ GitHub Sponsors] ( https://img.shields.io/github/sponsors/matteobruni )] ( https://github.com/sponsors/matteobruni )
5+ [ ![ npm] ( https://img.shields.io/npm/v/@tsparticles/vue2 )] ( https://www.npmjs.com/package/@tsparticles/vue2 ) [ ![ npm] ( https://img.shields.io/npm/dm/vue2-particles )] ( https://www.npmjs.com/package/vue2-particles ) [ ![ GitHub Sponsors] ( https://img.shields.io/github/sponsors/matteobruni )] ( https://github.com/sponsors/matteobruni )
66
77Official [ tsParticles] ( https://github.com/matteobruni/tsparticles ) VueJS component
88
@@ -20,8 +20,16 @@ yarn add @tsparticles/vue2
2020
2121``` javascript
2222import Particles from " @tsparticles/vue2" ;
23+ // 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.
2325
24- Vue .use (Particles);
26+ Vue .use (Particles, {
27+ init: async (engine ) => {
28+ // await loadFull(engine);
29+ await loadSlim (engine);
30+
31+ }
32+ });
2533```
2634
2735### Demo config
@@ -31,7 +39,6 @@ Vue.use(Particles);
3139 <div id =" app" >
3240 <vue-particles
3341 id =" tsparticles"
34- :particlesInit =" particlesInit"
3542 :particlesLoaded =" particlesLoaded"
3643 url =" http://foo.bar/particles.json"
3744 />
@@ -40,7 +47,6 @@ Vue.use(Particles);
4047
4148 <vue-particles
4249 id =" tsparticles"
43- :particlesInit =" particlesInit"
4450 :particlesLoaded =" particlesLoaded"
4551 :options =" {
4652 background: {
@@ -121,14 +127,6 @@ Vue.use(Particles);
121127```
122128
123129``` javascript
124- // import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
125- import { loadSlim } from " @tsparticles/slim" ; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.
126-
127- const particlesInit = async engine => {
128- // await loadFull(engine);
129- await loadSlim (engine);
130- };
131-
132130const particlesLoaded = async container => {
133131 console .log (" Particles container loaded" , container);
134132};
0 commit comments