Browse Source

[build] 0.8.0

Evan You 9 years ago
parent
commit
dae41b1116
2 changed files with 23 additions and 10 deletions
  1. 22 9
      dist/vuex.js
  2. 1 1
      dist/vuex.min.js

+ 22 - 9
dist/vuex.js

@@ -1,5 +1,5 @@
 /*!
- * Vuex v0.7.1
+ * Vuex v0.8.0
  * (c) 2016 Evan You
  * Released under the MIT License.
  */
@@ -142,13 +142,31 @@
   };
 
   function override (Vue) {
-    Vue.mixin({ init: init });
+    var version = Number(Vue.version.split('.')[0]);
+
+    if (version >= 2) {
+      Vue.mixin({
+        init: vuexInit
+      });
+    } else {
+      (function () {
+        // override init and inject vuex init procedure
+        // for 1.x backwards compatibility.
+        var _init = Vue.prototype._init;
+        Vue.prototype._init = function () {
+          var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+          options.init = options.init ? [vuexInit].concat(options.init) : vuexInit;
+          _init.call(this, options);
+        };
+      })();
+    }
 
     /**
      * Vuex init hook, injected into each instances init hooks list.
      */
 
-    function init() {
+    function vuexInit() {
       var options = this.$options;
       var store = options.store;
       var vuex = options.vuex;
@@ -611,14 +629,9 @@
     install(window.Vue);
   }
 
-  function createLogger() {
-    console.warn('[vuex] Vuex.createLogger has been deprecated.' + 'Use `import createLogger from \'vuex/logger\' instead.');
-  }
-
   var index = {
     Store: Store,
-    install: install,
-    createLogger: createLogger
+    install: install
   };
 
   return index;

File diff suppressed because it is too large
+ 1 - 1
dist/vuex.min.js


Some files were not shown because too many files changed in this diff