Browse Source

prevent multiple installs (#136)

Evan You 9 năm trước cách đây
mục cha
commit
bfa81dbda6
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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)
 }