Skip to content

Commit be75d41

Browse files
Austioktsn
authored andcommitted
feat: add ability to turn off devtools on vuex by passing an off options (#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
1 parent f22d472 commit be75d41

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/api/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ const store = new Vuex.Store({ ...options })
116116
117117
[Details](../guide/strict.md)
118118
119+
### devtools
120+
121+
- type: `Boolean`
122+
123+
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.
124+
125+
``` js
126+
{
127+
devtools: false
128+
}
129+
```
130+
131+
119132
## Vuex.Store Instance Properties
120133
121134
### state

src/store.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export class Store {
6363
// apply plugins
6464
plugins.forEach(plugin => plugin(this))
6565

66-
if (Vue.config.devtools) {
66+
const useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools
67+
if (useDevtools) {
6768
devtoolPlugin(this)
6869
}
6970
}

0 commit comments

Comments
 (0)