You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/api.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,24 @@ const store = new Vuex.Store({ ...options })
26
26
27
27
[Details](mutations.md)
28
28
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. Amodule'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.
0 commit comments