Skip to content

Commit

Permalink
feat: add ability to turn off devtools on vuex by passing an off opti…
Browse files Browse the repository at this point in the history
…ons (#1407)

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

* Swap order of precedence so that we use the options devtools over the vues devtools
  • Loading branch information
Austio authored and ktsn committed Oct 2, 2018
1 parent f22d472 commit be75d41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit be75d41

Please sign in to comment.