From 37a842b3950c941568149daab72c449cadfc8af9 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 1 Feb 2022 08:15:19 +0000 Subject: [PATCH] Add main.ts --- web/src/main.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 web/src/main.ts diff --git a/web/src/main.ts b/web/src/main.ts new file mode 100644 index 0000000..e6b7cdd --- /dev/null +++ b/web/src/main.ts @@ -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(); +})