Skip to content

Add ability to turn off devtools on vuex by passing an off options #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ const store = new Vuex.Store({ ...options })

[Details](../guide/strict.md)

### devtools

- type: `Boolean`

Turn the devtools on or off for a particular vuex instance. For instance passing false tells the Vuex store to not subscribe to devtools plugin. Useful for if you have multiple stores on a single page.

``` js
{
devtools: false
}
```


## Vuex.Store Instance Properties

### state
Expand Down
3 changes: 2 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export class Store {
// apply plugins
plugins.forEach(plugin => plugin(this))

if (Vue.config.devtools) {
const useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools
if (useDevtools) {
devtoolPlugin(this)
}
}
Expand Down