Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Update app-vuex-store.md #619

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/guide/app-vuex-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,13 @@ export default {
</script>
```

## 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.