diff --git a/source/guide/app-vuex-store.md b/source/guide/app-vuex-store.md index 5ac1f720..ae97b6ed 100644 --- a/source/guide/app-vuex-store.md +++ b/source/guide/app-vuex-store.md @@ -111,5 +111,13 @@ export default { ``` +## Using Multiple Modules + +Within each Vuex Module, properties are accessed as `state`, e.g., `state.drawerState = opened`. If you have multiple modules within you Vuex store, you can reference from one module to another using `rootState`. For example, if you had a separate `users` module and you needed to access the current user's userID in the `showcase` module, you could use: + +```js +const currentUser = rootState.users.currentUser.userID +``` + ## Store Code Splitting You can take advantage of the [PreFetch Feature](/guide/app-prefetch-feature.html#Store-Code-Splitting) to code split code for modules.