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 1
1
/*!
2
- * Vuex v0.7.1
2
+ * Vuex v0.8.0
3
3
* (c) 2016 Evan You
4
4
* Released under the MIT License.
5
5
*/
142
142
} ;
143
143
144
144
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
+ }
146
164
147
165
/**
148
166
* Vuex init hook, injected into each instances init hooks list.
149
167
*/
150
168
151
- function init ( ) {
169
+ function vuexInit ( ) {
152
170
var options = this . $options ;
153
171
var store = options . store ;
154
172
var vuex = options . vuex ;
611
629
install ( window . Vue ) ;
612
630
}
613
631
614
- function createLogger ( ) {
615
- console . warn ( '[vuex] Vuex.createLogger has been deprecated.' + 'Use `import createLogger from \'vuex/logger\' instead.' ) ;
616
- }
617
-
618
632
var index = {
619
633
Store : Store ,
620
- install : install ,
621
- createLogger : createLogger
634
+ install : install
622
635
} ;
623
636
624
637
return index ;
You can’t perform that action at this time.
0 commit comments