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

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    activeIdx: 0,
    isLoading: false,
    isShowLogin: false
  },
  mutations: {
    setActiveIdx(state, value) {
      state.activeIdx = value;
    },
    setIsLoading(state, value) {
      state.isLoading = value;
    },
    setIsShowLogin(state, value) {
      state.isShowLogin = value;
    }
  },
  actions: {
    setActiveIdx({ commit }, args) {
      commit("setActiveIdx", args);
    },
    setIsLoading({ commit }, args) {
      commit("setIsLoading", args);
    },
    setIsShowLogin({ commit }, args) {
      commit("setIsShowLogin", args);
    }
  },
  modules: {}
});
