Преглед на файлове

Fix: arguments for getters missing in API (#331)

* Fix: arguments for getters missing in API

as per `v2.0.0-rc.3`, getters receive 3 arguments: `state, getters, rootState`. However only the first is currently documented. This PR fixes this.

* Update api.md

fix grammar

* remove ")"
Thorsten Lünborg преди 8 години
родител
ревизия
356e90a307
променени са 1 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 7 2
      docs/en/api.md

+ 7 - 2
docs/en/api.md

@@ -48,8 +48,13 @@ const store = new Vuex.Store({ ...options })
 
   - type: `{ [key: string]: Function }`
 
-    Register getters on the store. The getter function receives the `state` as the first argument (will be module local state if defined in a module).
-
+    Register getters on the store. The getter function receives the following arguments:
+    
+    ```
+    state,     // will be module local state if defined in a module.
+    getters,   // same as store.getters
+    rootState  // same as store.state
+    ```
     Registered getters are exposed on `store.getters`.
 
     [Details](getters.md)