We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01b1e55 commit 450b0dcCopy full SHA for 450b0dc
1 file changed
src/views/Dashboard.vue
@@ -1,9 +1,12 @@
1
<template>
2
<div>
3
<h1>Dashboard</h1>
4
- <template v-if="events !== 'Loading events...'">
+ <template v-if="!isLoading">
5
<EventCard v-for="event in events" :key="event.id" :event="event" />
6
</template>
7
+ <p v-else>
8
+ Loading events
9
+ </p>
10
</div>
11
12
@@ -14,11 +17,15 @@ import EventCard from '../components/EventCard'
14
17
export default {
15
18
components: { EventCard },
16
19
data () {
- return { events: 'Loading events...' }
20
+ return {
21
+ isLoading: true,
22
+ events: []
23
+ }
24
},
25
created () {
26
axios.get('//localhost:3000/dashboard').then(({ data }) => {
27
this.events = data.events.events
28
+ this.isLoading = false
29
})
30
}
31
0 commit comments