浏览代码

修正mutation内操作state的行为

没记错的话,state应该是整个state
Yong Yin 9 年之前
父节点
当前提交
b5dfbd9b2a
共有 1 个文件被更改,包括 1 次插入1 次删除
  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: {