import { createApp } from 'vue' import App from './App.vue' import './index.css' import router from './router' import { createPinia } from 'pinia' import { useBudgetsStore } from './stores/budget'; import { useAccountStore } from './stores/budget-account' import PiniaLogger from './pinia-logger' const app = createApp(App) app.use(router) const pinia = createPinia() pinia.use(PiniaLogger()) app.use(pinia) app.mount('#app') router.beforeEach(async (to, from, next) => { const budgetStore = useBudgetsStore(); await budgetStore.SetCurrentBudget((to.params.budgetid)); const accountStore = useAccountStore(); await accountStore.SetCurrentAccount((to.params.budgetid), (to.params.accountid)); next(); })