gancio/pages/index.vue

30 lines
657 B
Vue
Raw Normal View History

2019-04-03 00:25:12 +02:00
<template lang="pug">
2019-05-30 12:04:14 +02:00
#home
Nav
Home
2019-06-06 23:54:32 +02:00
2019-04-03 00:25:12 +02:00
</template>
2019-05-30 12:04:14 +02:00
<script>
import Home from '~/components/Home.vue'
import Nav from '~/components/Nav.vue'
2019-06-06 23:54:32 +02:00
import { mapState } from 'vuex'
2019-05-30 12:04:14 +02:00
export default {
name: 'Index',
2019-06-06 23:54:32 +02:00
async fetch ({ store, $axios }) {
2019-06-07 17:02:33 +02:00
try {
const now = new Date()
const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
store.commit('setEvents', events)
const { tags, places } = await $axios.$get('/event/meta')
store.commit('update', { tags, places })
} catch(e) {
console.error(e)
}
2019-06-06 23:54:32 +02:00
},
computed: mapState(['events']),
2019-05-30 12:04:14 +02:00
components: { Nav, Home },
}
</script>