import Vue from 'vue'
import vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'

Vue.use(vuex);
import menu from './modules/menu'
import app from './modules/app'
import tabsbar from './modules/tabsbar'
import process from './modules/process'
import color from './modules/color'

const store = new vuex.Store({
	modules: {
		app: app,
		menu: menu,
		tabsbar: tabsbar,
		process: process,
		color: color,
	},
	plugins: [createPersistedState({
		reducer(val) {
			return {
				// 只储存state中的user
				tabsbar: val.tabsbar
			}
		}
	})]
})


export default store
