web-africa-h5/store/index.js

38 lines
726 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Vue from 'vue'
import Vuex from "vuex"
Vue.use(Vuex)
export default new Vuex.Store({
// 全局属性变量
state: { // state的作用是定义属性变量。定义一个参数
orderDetail: null,
host: '',
currencyIcon: '',
languages:[],
localLang:''
},
// 全局同步方法在methods{this.$store.commit("changeTheme")}
mutations: {
changeOrderDetail(state, value) {
state.orderDetail = value;
},
changeHost(state, value) {
state.host = value;
},
changeCurrency(state, value) {
state.currencyIcon = value;
},
changeLanguages(state, value) {
state.languages = value;
},
changeLocal(state, value) {
state.localLang = value;
}
},
getters: {
},
actions: {
}
})