Browse Source

perf: do not connect devtools if Vue.config.devtools == false (#881)

katashin 7 years ago
parent
commit
dd7f8178d9
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/store.js

+ 5 - 1
src/store.js

@@ -58,7 +58,11 @@ export class Store {
     resetStoreVM(this, state)
     resetStoreVM(this, state)
 
 
     // apply plugins
     // apply plugins
-    plugins.concat(devtoolPlugin).forEach(plugin => plugin(this))
+    plugins.forEach(plugin => plugin(this))
+
+    if (Vue.config.devtools) {
+      devtoolPlugin(this)
+    }
   }
   }
 
 
   get state () {
   get state () {