store.state.count: {{ store.state.count }}
调用computed(halfCount): {{ halfCount }}
+store.getters.doubleCount: {{ store.getters.doubleCount }}
store.getters.moreCount(10): {{ store.getters.moreCount(10) }}
+ +store.commit('increment', {num: 7}): + +
+store.commit({type: "increment", num: 5}): + +
diff --git a/src/views/OptionsAPIView.vue b/src/views/OptionsAPIView.vue index 9dcdb48..9773e44 100644 --- a/src/views/OptionsAPIView.vue +++ b/src/views/OptionsAPIView.vue @@ -1,17 +1,40 @@ +this.$store.state.count: {{ this.$store.state.count }}
调用computed(halfCount): {{ halfCount }}
+this.$store.getters.doubleCount: {{ this.$store.getters.doubleCount }}
this.$store.getters.moreCount(10): {{ this.$store.getters.moreCount(10) }}
+ +this.$store.commit('increment', {num: 7})}: + +
+this.$store.commit({type: "increment", num: 5})}: + +