import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
//自定义getters
import getters from './getters'
//批量引入modules下的js
const modules = {}
const modulesContext = require.context('./modules', false, /\.js$/)
modulesContext.keys().forEach(key => {
	modules[key.slice(2, -3)] = modulesContext(key).default
})
//初始化store
const store = new Vuex.Store({
	modules,
	getters
})

export default store
