diff --git a/src/store/modules/ModuleB.js b/src/store/modules/ModuleB.js index 0f1683a..78412a5 100644 --- a/src/store/modules/ModuleB.js +++ b/src/store/modules/ModuleB.js @@ -18,6 +18,6 @@ export const moduleB = { if (content.state.state_b > 50) { content.commit('mutation_b', {num: payload.num}) } - } + }, } } diff --git a/src/views/OptionsAPIView.vue b/src/views/OptionsAPIView.vue index dc72f0a..afef248 100644 --- a/src/views/OptionsAPIView.vue +++ b/src/views/OptionsAPIView.vue @@ -13,27 +13,44 @@
根-this.$store.commit('mutation', {num: 7}): - +
根-@click="mutation({num: 7})": +
-A-this.$store.commit('mutation_a', {num: 8}): - +
A-@click="mutation_a({num: 8})": +
-B-this.$store.commit('module_b/mutation_b', {num: 9}): - +
B-@click="mutation_b({num: 9})": +
根-mutation: - +
根-@click="action({num: 7})": +
-A-this.$store.dispatch('action_a', {num: 8}): - +
A-@click="action_a({num: 8})": +
-B-this.$store.dispatch('module_b/action_b', {num: 9}): - +
B-@click="action_b({num: 9})": +
+ +state_b_getter_a: (state, getters) => state.module_b.state_b + getters.getter_a: {{ + state_b_getter_a + }}
+state_a_getter_b: (state, getters) => state.module_a.state_a + getters["module_b/getter_b"]: {{ + state_a_getter_b + }}
+state_b_getter_b: (state, getters) => state.state_b + getters.getter_b: {{ state_b_getter_b }} +
+@click="mutation_a_count(100): + +
+@click="action_b_count(200): + +
+