File tree Expand file tree Collapse file tree 2 files changed +24
-11
lines changed
Expand file tree Collapse file tree 2 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 11/*!
2- * Vuex v0.7.1
2+ * Vuex v0.8.0
33 * (c) 2016 Evan You
44 * Released under the MIT License.
55 */
142142 } ;
143143
144144 function override ( Vue ) {
145- Vue . mixin ( { init : init } ) ;
145+ var version = Number ( Vue . version . split ( '.' ) [ 0 ] ) ;
146+
147+ if ( version >= 2 ) {
148+ Vue . mixin ( {
149+ init : vuexInit
150+ } ) ;
151+ } else {
152+ ( function ( ) {
153+ // override init and inject vuex init procedure
154+ // for 1.x backwards compatibility.
155+ var _init = Vue . prototype . _init ;
156+ Vue . prototype . _init = function ( ) {
157+ var options = arguments . length <= 0 || arguments [ 0 ] === undefined ? { } : arguments [ 0 ] ;
158+
159+ options . init = options . init ? [ vuexInit ] . concat ( options . init ) : vuexInit ;
160+ _init . call ( this , options ) ;
161+ } ;
162+ } ) ( ) ;
163+ }
146164
147165 /**
148166 * Vuex init hook, injected into each instances init hooks list.
149167 */
150168
151- function init ( ) {
169+ function vuexInit ( ) {
152170 var options = this . $options ;
153171 var store = options . store ;
154172 var vuex = options . vuex ;
611629 install ( window . Vue ) ;
612630 }
613631
614- function createLogger ( ) {
615- console . warn ( '[vuex] Vuex.createLogger has been deprecated.' + 'Use `import createLogger from \'vuex/logger\' instead.' ) ;
616- }
617-
618632 var index = {
619633 Store : Store ,
620- install : install ,
621- createLogger : createLogger
634+ install : install
622635 } ;
623636
624637 return index ;
You can’t perform that action at this time.
0 commit comments