| 
						 | 
						import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vuex)
let state = {	currentTabBar: 0,	tabbars: [		{		  name: 'home',		  text: '首页',		  icon: 'icon-xianxingicon-03',		  path: '/pages/index/index/index',		  show: true		},		{		  name: 'brand',		  text: '品牌',		  icon: 'icon-pinpailiebiao',		  path: '/pages/index/category/category',		  show: true		},		{		  name: 'find',		  text: '发现',		  icon: 'icon-faxian',		  path: '/pages/discover/discover',		  show: true		},		{		  name: 'my',		  text: '会员中心',		  icon: 'icon-icon',		  path: '/pages/user/my/center',		  show: true		}	],	isShowTabBar: true}
let mutations = {	// 修改tabbar当前选中的item
	setCurrentTabBar(state, data){		state.currentTabBar = data;	},	// 显示tabbar
	showTabBar(state, data){		state.isShowTabBar = true;	},	// 隐藏tabbar
	hideTabBar(state, data){		state.isShowTabBar = false;	},	// 设置某个tabbar项显示隐藏
	setTabbarItemShow(state, data){		let { index, is_show } = data;		state.tabbars[index].show = is_show;	}}
let actions = {	// 异步调用修改tabbar当前选中的item
	setCurrentTabBarAsync(context, args){		context.commit('setCurrentTabBar', args);	}}
let getters = {	currentTabBar: state => state.currentTabBar,	tabbars: state => state.tabbars,	isShowTabBar: state => state.isShowTabBar}
export default new Vuex.Store({	state,	mutations,	actions,	getters})
/*	getters:可以认为是 store 的计算属性,然后在组件的计算属性中使用:...mapGetters([])	mutations: 修改state的值,调用:store.commit('test', 'hello')	actions: 异步提交mutations	module:区分模块,每个模块都有自己的 state、mutation、action、getter、甚至是嵌套子模块(项目大时可能需要用到)*/
  |