Sfoglia il codice sorgente

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 anni fa
parent
commit
356e90a307
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  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)