gradido/frontend/src/main.js
2021-05-07 11:59:43 +02:00

32 lines
577 B
JavaScript
Executable File

import Vue from 'vue'
import DashboardPlugin from './plugins/dashboard-plugin'
import App from './App.vue'
import i18n from './i18n.js'
// store
import { store } from './store/store'
// router setup
import router from './routes/router'
// plugin setup
Vue.use(DashboardPlugin)
Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
if (to.meta.requiresAuth && !store.state.session_id) {
next({ path: '/login' })
} else {
next()
}
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
i18n,
render: (h) => h(App),
})