diff --git a/web/src/main.js b/web/src/main.js index 87c76be..83f2df6 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -1,6 +1,26 @@ import { createApp } from 'vue' +import { createStore } from 'vuex' import App from './App.vue' import router from './router/index.js' +const store = createStore({ + state () { + return { + Budgets: [], + CurrentBudget: null, + } + }, + mutations: { + getDashboard (state) { + fetch("/dashboard") + .then(x => x.json()) + .then(x => console.log(x)) + .then(x => state.Budgets = x.Budgets); + } + } +}) + const app = createApp(App) -app.use(router).mount('#app') +app.use(router) +app.use(store) +app.mount('#app') diff --git a/web/src/pages/Dashboard.vue b/web/src/pages/Dashboard.vue index a785adb..b545c36 100644 --- a/web/src/pages/Dashboard.vue +++ b/web/src/pages/Dashboard.vue @@ -1,9 +1,8 @@ +