Skip to content

Commit 75e8e09

Browse files
committed
Using this.page
1 parent c74adfa commit 75e8e09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/views/EventList.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default {
2323
EventCard
2424
},
2525
created() {
26-
this.perPage = 3 // Setting perPage here and not in data means it won't be reactive
27-
// We don't need it to be reactive.
26+
this.perPage = 3 // Setting perPage here and not in data means it won't be reactive.
27+
// We don't need it to be reactive, and this way our component has access to it.
2828
2929
this.$store.dispatch('fetchEvents', {
3030
perPage: this.perPage,
@@ -36,7 +36,7 @@ export default {
3636
return parseInt(this.$route.query.page) || 1
3737
},
3838
isLastPage() {
39-
return this.eventsTotal > this.page * this.perPage
39+
return this.eventsTotal > this.page * 3
4040
},
4141
...mapState(['events', 'eventsTotal'])
4242
}

0 commit comments

Comments
 (0)