budgeteer/web/src/main.js
2022-01-21 14:20:45 +00:00

27 lines
609 B
JavaScript

import { createApp } from 'vue/dist/vue.esm-bundler'
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("/api/v1/dashboard")
.then(x => x.json())
.then(x => console.log(x))
.then(x => state.Budgets = x.Budgets);
}
}
})
const app = createApp(App)
app.use(router)
app.use(store)
app.mount('#app')