import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    activeMenuItem: "设备管理", // 用来存储当前活跃的菜单项
  },
  getters: {},
  mutations: {
    setActiveMenuItem(state, menuItem) {
      state.activeMenuItem = menuItem;
    },
  },
  actions: {
    updateActiveMenuItem({ commit }, menuItem) {
      commit("setActiveMenuItem", menuItem);
    },
  },
  modules: {},
});
