Implement dummy Budget-Settings and extract setTitle mutation

This commit is contained in:
2022-01-25 20:40:00 +00:00
parent 74c4c7cb02
commit ffed94f586
5 changed files with 9 additions and 13 deletions

View File

@ -1,3 +1,5 @@
import { TITLE } from "../mutation-types";
const budget = {
state () {
return {
@ -62,7 +64,7 @@ const budget = {
continue
commit("setCurrentAccount", element);
commit("setTitle", element.Name);
commit(TITLE, element.Name);
break
}
}

View File

@ -1,7 +1,7 @@
import { createStore } from 'vuex'
import dashboard from './dashboard/index'
import budget from './budget/index'
import { LOGIN_SUCCESS, LOGOUT } from './mutation-types'
import { LOGIN_SUCCESS, LOGOUT, TITLE } from './mutation-types'
const store = createStore({
state () {
@ -21,7 +21,7 @@ const store = createStore({
);
}
},
setTitle (state, title) {
[TITLE](state, title) {
document.title = "Budgeteer - " + title;
},
[LOGIN_SUCCESS](state, session) {