faszom
This commit is contained in:
@@ -4,12 +4,33 @@ import Vuex from 'vuex'
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
},
|
||||
mutations: {
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
state: {
|
||||
userdata: {
|
||||
name: null
|
||||
},
|
||||
appReady: false
|
||||
},
|
||||
mutations: {
|
||||
storeUserData(state, username) {
|
||||
state.userdata.name = username;
|
||||
},
|
||||
setAppReady(state) {
|
||||
state.appReady = true;
|
||||
}
|
||||
|
||||
},
|
||||
actions: {
|
||||
storeUserData({commit}, username) {
|
||||
commit('storeUserData', username);
|
||||
},
|
||||
setAppReady({commit}) {
|
||||
commit('setAppReady');
|
||||
}
|
||||
},
|
||||
modules: {},
|
||||
getters: {
|
||||
isLoggedIn(state) {
|
||||
return !!state.userdata.name;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user