重构优化框架
这是一个大版本的更新 现在,框架更加稳定
This commit is contained in:
34
Yi.Vue2.x/src/store/modules/loader.js
Normal file
34
Yi.Vue2.x/src/store/modules/loader.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const state = { //状态
|
||||
load: false
|
||||
}
|
||||
|
||||
const mutations = { //变化//载荷
|
||||
OPEN(state) {
|
||||
state.load = true;
|
||||
},
|
||||
CLOSE(state) {
|
||||
state.load = false;
|
||||
},
|
||||
}
|
||||
|
||||
//在action中可以配合axios进行权限判断
|
||||
const actions = { //动作
|
||||
openLoad(context) {
|
||||
context.commit('OPEN')
|
||||
},
|
||||
closeLoad(context) {
|
||||
context.commit('CLOSE')
|
||||
}
|
||||
}
|
||||
|
||||
// const getters = { //类似与计算属性 派生属性
|
||||
// msg(state) {
|
||||
// if (state.count > 80) {
|
||||
// return "成绩优异"
|
||||
// } else {
|
||||
// return "成绩不合格"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
export default { state, mutations, actions }
|
||||
Reference in New Issue
Block a user