Browse Source

修正mutation内操作state的行为

没记错的话,state应该是整个state
Yong Yin 9 years ago
parent
commit
b5dfbd9b2a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      docs/zh-cn/actions.md

+ 1 - 1
docs/zh-cn/actions.md

@@ -19,7 +19,7 @@ const store = new Vuex.Store({
   },
   mutations: {
     INCREMENT (state, x) {
-      state += x
+      state.count += x
     }
   },
   actions: {