Sfoglia il codice sorgente

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

katashin 7 anni fa
parent
commit
dd7f8178d9
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/store.js

+ 5 - 1
src/store.js

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