123456789101112131415161718192021222324252627282930 |
- import Vue from 'vue'
- import App from './App.vue'
- import router from './routes'
- import store from './store'
- import vuetify from './plugins/vuetify'
- Vue.config.productionTip = false
- store.commit('initFromLocalstore');
- router.beforeEach((to, from, next) => {
- if (to.matched.some(record => record.meta.requiresLogin)) {
- if (!store.getters.loggedIn) {
- next({ name: 'login' })
- } else {
- next()
- }
- } else {
- next()
- }
- })
- new Vue({
- router,
- store,
- vuetify,
- render: h => h(App)
- }).$mount('#app')
|