Browse Source

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

katashin 7 năm trước cách đây
mục cha
commit
dd7f8178d9
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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 () {