Skip to content

Commit 9bcdb9c

Browse files
committed
[docs] modules api reference
1 parent 1ab2c81 commit 9bcdb9c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/en/api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ const store = new Vuex.Store({ ...options })
2626

2727
[Details](mutations.md)
2828

29+
- **modules**
30+
31+
- type: `Object`
32+
33+
An object containing sub modules to be merged into the store, in the shape of:
34+
35+
``` js
36+
{
37+
key: {
38+
state,
39+
mutations
40+
},
41+
...
42+
}
43+
```
44+
45+
Each module can contain `state` and `mutations` similar to the root options. A module's state will be attached to the store's root state using the module's key. A module's mutations will only receives the module's own state as the first argument instead of the root state.
46+
2947
- **middlewares**
3048
3149
- type: `Array<Object>`

0 commit comments

Comments
 (0)