Explorar o código

prevent multiple installs (#136)

Evan You %!s(int64=9) %!d(string=hai) anos
pai
achega
bfa81dbda6
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/index.js

+ 6 - 0
src/index.js

@@ -255,6 +255,12 @@ class Store {
 }
 
 function install (_Vue) {
+  if (Vue) {
+    console.warn(
+      '[vuex] already installed. Vue.use(Vuex) should be called only once.'
+    )
+    return
+  }
   Vue = _Vue
   override(Vue)
 }