Browse Source

handle not installed case

Evan You 9 years ago
parent
commit
8a0118a543
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/index.js

+ 5 - 0
src/index.js

@@ -35,6 +35,11 @@ class Store {
     // use a Vue instance to store the state tree
     // suppress warnings just in case the user has added
     // some funky global mixins
+    if (!Vue) {
+      throw new Error(
+        '[vuex] must call Vue.use(Vuex) before creating a store instance.'
+      )
+    }
     const silent = Vue.config.silent
     Vue.config.silent = true
     this._vm = new Vue({