import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex); //vue的插件机制

import api from '@/api/api.js'

//Vuex.Store 构造器选项
const store = new Vuex.Store({
	state: {
		configList: [], //配置列表
		count : 10,
	},
	getters: {},
	mutations: {
		// 初始化配置
		initConfig(state){
			api('getConfig', res => {
				if(res.code == 200){
					state.configList = res.result
				}
			})
		},
	},
	actions: {},
})

export default store