浏览代码

[zh-cn] synced from #bb76bfd to #687962b (#1045)

* [zh-cn] synced from #bb76bfd to #86677eb

* [zh-cn] synced from #86677eb to #687962b
勾三股四 7 年之前
父节点
当前提交
1fe9f95e7d
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 1 1
      docs/zh-cn/actions.md
  2. 6 5
      docs/zh-cn/api.md
  3. 1 1
      docs/zh-cn/getters.md

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

@@ -158,7 +158,7 @@ actions: {
 }
 ```
 
-最后,如果我们利用 [async / await](https://tc39.github.io/ecmascript-asyncawait/) 这个 JavaScript 即将到来的新特性,我们可以像这样组合 action:
+最后,如果我们利用 [async / await](https://tc39.github.io/ecmascript-asyncawait/),我们可以如下组合 action:
 
 ``` js
 // 假设 getData() 和 getOtherData() 返回的是 Promise

+ 6 - 5
docs/zh-cn/api.md

@@ -36,11 +36,12 @@ const store = new Vuex.Store({ ...options })
 
     ``` js
     {
-      state,     // 等同于 store.state, 若在模块中则为局部状态
-      rootState, // 等同于 store.state, 只存在于模块中
-      commit,    // 等同于 store.commit
-      dispatch,  // 等同于 store.dispatch
-      getters    // 等同于 store.getters
+      state,      // 等同于 `store.state`,若在模块中则为局部状态
+      rootState,  // 等同于 `store.state`,只存在于模块中
+      commit,     // 等同于 `store.commit`
+      dispatch,   // 等同于 `store.dispatch`
+      getters,    // 等同于 `store.getters`
+      rootGetters // 等同于 `store.getters`,只存在于模块中
     }
     ```
 

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

@@ -68,7 +68,7 @@ computed: {
 ```js
 getters: {
   // ...
-  getTodoById: (state, getters) => (id) => {
+  getTodoById: (state) => (id) => {
     return state.todos.find(todo => todo.id === id)
   }
 }