| | |
| | | |
| | | Vue.use(Vuex); |
| | | const state = { //全局状态值 |
| | | loginType: false, |
| | | userId:'', |
| | | loginType: false, |
| | | userId: '' |
| | | } |
| | | |
| | | const mutations = { |
| | | loginType: (state, val) => { |
| | | state.loginType = val; |
| | | }, |
| | | userId:(state, val) => { |
| | | state.userId = val; |
| | | }, |
| | | loginType: (state, val) => { |
| | | state.loginType = val |
| | | }, |
| | | userId: (state, val) => { |
| | | state.userId = val |
| | | } |
| | | } |
| | | |
| | | const getters = { |
| | | getLoginType: (state) => { |
| | | return state.loginType; |
| | | }, |
| | | getUserId:(state) => { |
| | | return state.userId; |
| | | }, |
| | | getLoginType: (state) => { |
| | | return state.loginType |
| | | }, |
| | | getUserId: (state) => { |
| | | return state.userId |
| | | } |
| | | } |
| | | |
| | | const actions = { |
| | |
| | | } |
| | | |
| | | const store = new Vuex.Store({ |
| | | state, |
| | | actions, |
| | | mutations, |
| | | getters, |
| | | state, |
| | | actions, |
| | | mutations, |
| | | getters |
| | | }) |
| | | |
| | | export default store; |
| | | export default store |