diff --git a/docs/api/README.md b/docs/api/README.md index 906167686..865e92f63 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -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 diff --git a/src/store.js b/src/store.js index b5b083c92..4251eaa73 100644 --- a/src/store.js +++ b/src/store.js @@ -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) } }