Add main.ts
This commit is contained in:
parent
9353d82648
commit
37a842b395
24
web/src/main.ts
Normal file
24
web/src/main.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { createApp } from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router/routes.js'
|
||||||
|
import { store, key } from './store/index.js'
|
||||||
|
import vuetify from './plugins/vuetify'
|
||||||
|
import { loadFonts } from './plugins/webfontloader'
|
||||||
|
import { SET_CURRENT_ACCOUNT, SET_CURRENT_BUDGET } from './store/action-types'
|
||||||
|
|
||||||
|
loadFonts()
|
||||||
|
|
||||||
|
const app = createApp(App)
|
||||||
|
app.use(router)
|
||||||
|
app.use(store, key)
|
||||||
|
app.use(vuetify)
|
||||||
|
app.mount('#app')
|
||||||
|
|
||||||
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
await store.dispatch(SET_CURRENT_BUDGET, to.params.budgetid);
|
||||||
|
await store.dispatch(SET_CURRENT_ACCOUNT, {
|
||||||
|
accountid: to.params.accountid,
|
||||||
|
budgetid: to.params.budgetid
|
||||||
|
});
|
||||||
|
next();
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user