You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
508 B
24 lines
508 B
1 year ago
|
export const moduleB = {
|
||
|
namespaced: true,
|
||
|
state: {
|
||
|
state_b: 2,
|
||
|
},
|
||
|
getters: {
|
||
|
getter_b: (state) => {
|
||
|
return state.state_b + 10;
|
||
|
}
|
||
|
},
|
||
|
mutations: {
|
||
|
mutation_b: (state, payload) => {
|
||
|
state.state_b += payload.num;
|
||
|
}
|
||
|
},
|
||
|
actions: {
|
||
|
action_b: (content, payload) => {
|
||
|
if (content.state.state_b > 50) {
|
||
|
content.commit('mutation_b', {num: payload.num})
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
}
|