// 页面路径：store/index.js 
import Vue from 'vue'
import Vuex from 'vuex'

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

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

//Vuex.Store 构造器选项
const store = new Vuex.Store({
	state:{//存放状态
		info : {},
		codeShow : false,
		searchShow : false,
	},
	getters : {
	},
	mutations : {
		getConfList(state){
			api('getConfList', {}, res => {
				if(res.code == 200){
					res.result.forEach(n => {
						if(n.keyValue == 'code'){
							state.codeShow = n.url == '0'
						}
						if(n.keyValue == 'search'){
							state.searchShow = n.url == '0'
						}
					})
				}
			})
		},
	},
	actions : {
	},
})

export default store
