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 asyncData ({ redirect, store }) {
|
|
|
|
// console.error('diocane', store.state.settings)
|
|
|
|
// const firstRun = store.state.settings.firstRun
|
|
|
|
// if (firstRun!==true) {
|
|
|
|
// redirect('/firstrun')
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
async fetch ({ store, $axios }) {
|
|
|
|
const now = new Date()
|
|
|
|
const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
|
|
|
|
console.error(events)
|
|
|
|
store.commit('setEvents', events)
|
|
|
|
const { tags, places } = await $axios.$get('/event/meta')
|
|
|
|
store.commit('update', { tags, places })
|
|
|
|
// const settings = await $axios.$get('/settings')
|
|
|
|
// store.commit('setSettings', settings)
|
|
|
|
},
|
|
|
|
computed: mapState(['events']),
|
2019-05-30 12:04:14 +02:00
|
|
|
components: { Nav, Home },
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|