1
This commit is contained in:
28
app/store/modules/app.js
Normal file
28
app/store/modules/app.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 应用全局状态管理
|
||||
*/
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
currentVersion: '1.0.0',
|
||||
isLoading: true,
|
||||
startTime: Date.now()
|
||||
},
|
||||
mutations: {
|
||||
SET_VERSION(state, version) {
|
||||
state.currentVersion = version;
|
||||
},
|
||||
SET_LOADING(state, loading) {
|
||||
state.isLoading = loading;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setVersion({ commit }, version) {
|
||||
commit('SET_VERSION', version);
|
||||
},
|
||||
setLoading({ commit }, loading) {
|
||||
commit('SET_LOADING', loading);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user