import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import * as user from './modules/user'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    permission,
    tagsView,
    user
  },
  state: {
    basicInfoData: ''
  },
  mutations: {
    updateBasicInfoData(state, payload) {
      state.basicInfoData = payload;
    }
  },
  actions: {
    setBasicInfoData({ commit }, data) {
      commit('updateBasicInfoData', data);
    }
  },
  getters
})

export default store
