This commit is contained in:
lesion
2019-06-07 17:02:33 +02:00
parent 7455553129
commit c408c44676
40 changed files with 270 additions and 279 deletions

View File

@@ -2,7 +2,6 @@
#home
Nav
Home
</template>
<script>
@@ -12,22 +11,16 @@ import { mapState } from 'vuex'
export default {
name: 'Index',
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)
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)
}
},
computed: mapState(['events']),
components: { Nav, Home },