File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " particles-bg-vue" ,
3
- "version" : " 1.1.1 " ,
3
+ "version" : " 1.1.2 " ,
4
4
"description" : " Vue.js component for particles backgrounds" ,
5
5
"author" : " creotip@gmail.com" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export default {
50
50
color: String ,
51
51
config: Object ,
52
52
canvas: Object ,
53
+ list: Array ,
53
54
globalCompositeOperation: String
54
55
},
55
56
data () {
@@ -80,6 +81,11 @@ export default {
80
81
return this .random .getResult ();
81
82
},
82
83
84
+ getFromList (){
85
+ if (! list) return this .getRandom ();
86
+ return list[Math .floor (Math .random () * list .length )];
87
+ },
88
+
83
89
setParticles : function () {
84
90
const type = this .type ;
85
91
let name = String (type).toLowerCase () || " random" ;
@@ -89,6 +95,10 @@ export default {
89
95
if (this .particles .indexOf (" random" ) === 0 ) {
90
96
this .particles = this .getRandom ();
91
97
}
98
+
99
+ if (this .particles .indexOf (" list" ) === 0 ) {
100
+ this .particles = this .getFromList ();
101
+ }
92
102
}
93
103
},
94
104
created () {
You can’t perform that action at this time.
0 commit comments