ProjectManagement_frontend/src/store/index.js

24 lines
443 B
JavaScript

import { createStore } from 'vuex'
import createPersistedState from "vuex-persistedstate"
const store = createStore({
state () {
return {
staff: null
}
},
mutations: {
setStaff(state, staff) {
state.staff = staff
},
updateToken(state, Token) {
state.staff.Token = Token
},
clearStaff(state) {
state.staff = null
},
},
plugins: [createPersistedState()]
})
export default store