import {createStore} from 'vuex'


const store = createStore({
  state: {
    userInfo:null,
    menu:null,
    route:null,
    nameFlag:false,
    msgBoxFlag:false,
    nowzz:null,
    menuObj:{},
    treeFlag:false,
    registerValid:false,
    msgUnreadNum: 0
  },
  getters: {
    count(state) {
      return state.userInfo
    }
  },
  mutations: {
    setUserInfo(state, info) {
      state.userInfo = info
    },
    setMenu(state,menu){
      state.menu = menu
    },
    setMenuObj(state,menuObj){
      state.menuObj = menuObj
    },
    setRoute(state,route){
      state.route = route
    },
    setNameFlag(state,nameFlag){
      state.nameFlag = nameFlag
    },
    setMsgBoxFlag(state,msgBoxFlag){
      state.msgBoxFlag = msgBoxFlag
    },
    setNowzz(state,nowzz){
      state.nowzz = nowzz
    },
    setTreeFlag(state,treeFlag){
      state.treeFlag = treeFlag
    },
    setRegisterValid(state,registerValid){
      state.registerValid = registerValid
    },
    setUnreadNum(state, num) {
      state.msgUnreadNum = num
    },
  },
  actions: {}
});
export default store;

