20 lines
276 B
JavaScript
20 lines
276 B
JavaScript
|
import { createStore } from 'vuex'
|
||
|
|
||
|
const store = createStore({
|
||
|
state () {
|
||
|
return {
|
||
|
token: ''
|
||
|
}
|
||
|
},
|
||
|
mutations: {
|
||
|
setToken(state,value) {
|
||
|
state.token = value
|
||
|
},
|
||
|
clearToken(state) {
|
||
|
state.token = ''
|
||
|
},
|
||
|
}
|
||
|
})
|
||
|
|
||
|
|
||
|
export default store
|