feat:更新
This commit is contained in:
1 parent
f0ae730508
commit
31078e35be
12 files changed
+403
-51
No files matched your search
+36
-2
@@ -4,8 +4,42 @@ import Vuex from "vuex";
|
||||
Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {},
|
||||
mutations: {},
|
||||
state: {
|
||||
prizeInfo: [],
|
||||
ruleType: "one",
|
||||
remainTicketNum: 0
|
||||
},
|
||||
getters: {
|
||||
prizeInfo: state => {
|
||||
return state.prizeInfo;
|
||||
},
|
||||
prizeIdList: state => {
|
||||
const { prizeInfo } = state;
|
||||
const list = [];
|
||||
for (let index = 0; index < prizeInfo.length; index++) {
|
||||
const element = prizeInfo[index];
|
||||
list.push(element.prizeId);
|
||||
}
|
||||
return list;
|
||||
},
|
||||
ruleType: state => {
|
||||
return state.ruleType;
|
||||
},
|
||||
remainTicketNum: state => {
|
||||
return state.remainTicketNum;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
SetPrizeInfo(state, payload) {
|
||||
state.prizeInfo = payload;
|
||||
},
|
||||
SetRuleType(state, payload) {
|
||||
state.ruleType = payload;
|
||||
},
|
||||
SetRemainTicketNum(state, payload) {
|
||||
state.remainTicketNum = payload;
|
||||
}
|
||||
},
|
||||
actions: {},
|
||||
modules: {}
|
||||
});
|
||||
Reference in new issue
Block a user