/*
 * desc
 * CreateTime
 * Copyright  @zilvzsy
 * author  @zilvzsy
 */
import Vue from 'vue'
import Vuex from 'vuex'

//挂载Vuex
Vue.use(Vuex)


//创建VueX对象
const store = new Vuex.Store({
	state: {
		//存放的键值对就是所要管理的状态
		dialogPramas:{
			cancelText:'',
			confirmText:'',
			content:'',
			titleText:'',
			showDialog:false,
			showCancel:true,
			showBtnT:0,
			toastStyle:'',
			toastStatus:null,
			toastTime:2000,
			countDown:null,
			confirmTip:'',
			fail(){},
			success(){},
		},
		showModel:null
		
	},
	mutations: {
		//es6语法，等同edit:funcion(){...}
		handleDialog(state,res){
			state.showModel = res
			
			//在点击事件处理增加
			// 要改变就
			// store.commit("hadleDialog",要改变的参数)
			// store.commit("hadleDialog",res)
		}
		
	},
	actions: {
		
	},
	// modules:{
	// 	utils:{
	// 		state:{
	// 			showModel:null,
	// 		}
	// 	}
	// }
})

export default store
