.
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user