File tree 1 file changed +12
-18
lines changed
src/components/HomeGuilds 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change 22
22
row
23
23
wrap >
24
24
<v-flex
25
- v-for =" (guild, index) in guilds "
25
+ v-for =" (guild, index) in getGuilds "
26
26
:key =" index"
27
27
sm12
28
28
md4 >
@@ -49,30 +49,24 @@ import { mapGetters } from 'vuex'
49
49
},
50
50
data () {
51
51
return {
52
- guilds : []
52
+
53
53
}
54
54
},
55
55
computed: {
56
56
... mapGetters ( [ ' allGuilds' ] ),
57
57
58
- },
59
- created () {
60
- this .guilds .splice (0 , this .guilds .length )
61
- console .log (" *******************" )
62
- console .log (this .guilds )
63
- for (let x= 0 ; x<= 2 ;x++ ){
64
-
65
- let i = Math .random () * (0 - this .allGuilds .length )
66
- i = Math .round (i)
67
- i = Math .abs (i)
68
- this .guilds .push (this .allGuilds [x])
69
- console .log (i)
70
- // this.guilds.push(this.allGuilds[i])
71
- }
72
- console .log (this .guilds )
73
-
58
+ getGuilds (){
59
+ let guilds= []
74
60
61
+ for (let x= 0 ; x<= 2 ;x++ ){
62
+ let i = Math .random () * (0 - (this .allGuilds .length - 1 ))
63
+ i = Math .round (i)
64
+ i = Math .abs (i)
65
+ guilds .push (this .allGuilds [i])
66
+ }
67
+ return guilds
75
68
}
69
+ },
76
70
}
77
71
78
72
</script >
You can’t perform that action at this time.
0 commit comments