File tree 1 file changed +28
-4
lines changed
1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change 7
7
<b-row v-for =" event in events" :key =" event.id" no-gutters align-v =" center"
8
8
:class =" { event: true, 'highlight-event': highlightEvent(event.id) }" >
9
9
10
- <router-link :to =" { name: 'Event', params: { id: event.id } }"
11
- class =" d-flex align-items-center" :key =" event.id" >
10
+ <router-link :to =" routerLink(event.id)" class =" d-flex align-items-center" :key =" event.id" >
12
11
13
12
<b-col cols =" 2" class =" magnitude text-center" >
14
13
<strong >{{ event.locValues.data.mag.toFixed(1) }}</strong >
44
43
}
45
44
},
46
45
methods: {
47
- fetchEvents : function () {
46
+ routerLink : function (eventId )
47
+ {
48
+ let query = {}
49
+
50
+ if (this .$route .query .backUrlQuery ) {
51
+ query .backUrlQuery = this .$route .query .backUrlQuery
52
+ }
53
+
54
+ return {
55
+ name: ' Event' ,
56
+ params: {
57
+ id: eventId
58
+ },
59
+ query
60
+ }
61
+ },
62
+ fetchEvents : function ()
63
+ {
48
64
this .$http .get (apiSettings .endpointEvents , {
49
65
params: {
50
66
datetime_min: this .$moment .utc ().subtract (6 , ' months' ).format (' YYYY-MM-DD 00:00:00' ),
67
+ has_training: this .event .has_training ? 1 : 0 ,
51
68
include: ' nearestCity' ,
52
69
limit: 10
53
70
}
76
93
return false
77
94
}
78
95
},
96
+ watch: {
97
+ event : function (data ) {
98
+ if (this .inited === true ) return
99
+ this .inited = true
100
+ this .fetchEvents ()
101
+ }
102
+ },
79
103
created () {
80
- this . fetchEvents ()
104
+
81
105
}
82
106
}
83
107
</script >
You can’t perform that action at this time.
0 commit comments