mkm
/
yanzhiAPP
Template
2
0
Fork 0
yanzhiAPP/store/index.js

24 lines
363 B
JavaScript

import {
createStore
} from 'vuex'
const store = createStore({
state: {
userInfo:uni.getStorageSync("SY_USER")||null,
},
mutations: {
saveUserInfo(state, info) {
state.userInfo = info
uni.setStorageSync("SY_USER", info)
}
},
actions: {
saveUserInfo({commit}, info) {
commit('saveUserInfo', info)
}
}
})
export default store