import { createStore } from 'vuex' const store = createStore({ state: { userInfo: uni.getStorageSync("SY_USER") || null, tabbrIndex: 0, onScoket: false, }, mutations: { saveUserInfo(state, info) { state.userInfo = info uni.setStorageSync("SY_USER", info) }, changeTabbar(state, index) { state.tabbrIndex = index }, changeScoket(state, index) { state.onScoket = true } }, actions: { saveUserInfo({ commit }, info) { commit('saveUserInfo', info) }, changeTabbar({ commit }, info) { commit('changeTabbar', info) }, changeScoket({ commit }, info) { commit('changeScoket') } } }) export default store