Skip to content

Commit 73a13a3

Browse files
committed
update readme
1 parent 2aebb61 commit 73a13a3

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,25 @@ You can use type="custom" to achieve a higher degree of freedom for the particle
116116
```vue
117117
<particles-bg type="custom" :config="config" :bg="true"/>
118118
...
119-
120-
let config = {
121-
num: [4, 7],
122-
rps: 0.1,
123-
radius: [5, 40],
124-
life: [1.5, 3],
125-
v: [2, 3],
126-
tha: [-40, 40],
127-
alpha: [0.6, 0],
128-
scale: [1, 0.1],
129-
position: "center", // all or {x:1,y:1,width:100,height:100}
130-
color: ["random", "#ff0000"],
131-
cross: "dead", // cross or bround
132-
random: 15, // or null
133-
onParticleUpdate: (ctx, particle) => {
134-
ctx.beginPath();
135-
ctx.rect(particle.p.x, particle.p.y, particle.radius * 2, particle.radius * 2);
136-
ctx.fillStyle = particle.color;
137-
ctx.fill();
138-
ctx.closePath();
119+
120+
data: function() {
121+
return {
122+
config: {
123+
num: [4, 7],
124+
rps: 0.1,
125+
radius: [5, 40],
126+
life: [1.5, 3],
127+
v: [2, 3],
128+
tha: [-30, 30],
129+
body: icon,
130+
alpha: [0.6, 0],
131+
scale: [0.1, 0.4],
132+
position: "all",
133+
cross: "dead",
134+
random: 15
139135
}
140136
};
137+
}
141138
```
142139

143140
## License

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "particles-bg-vue",
3-
"version": "1.0.6",
3+
"version": "1.1.0",
44
"description": "Vue.js component for particles backgrounds",
55
"author": "creotip@gmail.com",
66
"license": "MIT",

0 commit comments

Comments
 (0)