1
1
/*!
2
- * Vue.js v2.1.7
2
+ * Vue.js v2.1.8
3
3
* (c) 2014-2016 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -82,10 +82,10 @@ function isPrimitive (value) {
82
82
*/
83
83
function cached ( fn ) {
84
84
var cache = Object . create ( null ) ;
85
- return function cachedFn ( str ) {
85
+ return ( function cachedFn ( str ) {
86
86
var hit = cache [ str ] ;
87
87
return hit || ( cache [ str ] = fn ( str ) )
88
- }
88
+ } )
89
89
}
90
90
91
91
/**
@@ -1300,7 +1300,7 @@ function assertProp (
1300
1300
}
1301
1301
for ( var i = 0 ; i < type . length && ! valid ; i ++ ) {
1302
1302
var assertedType = assertType ( value , type [ i ] ) ;
1303
- expectedTypes . push ( assertedType . expectedType ) ;
1303
+ expectedTypes . push ( assertedType . expectedType || '' ) ;
1304
1304
valid = assertedType . valid ;
1305
1305
}
1306
1306
}
@@ -1791,9 +1791,8 @@ Watcher.prototype.teardown = function teardown () {
1791
1791
if ( this . active ) {
1792
1792
// remove self from vm's watcher list
1793
1793
// this is a somewhat expensive operation so we skip it
1794
- // if the vm is being destroyed or is performing a v-for
1795
- // re-render (the watcher list is then filtered by v-for).
1796
- if ( ! this . vm . _isBeingDestroyed && ! this . vm . _vForRemoving ) {
1794
+ // if the vm is being destroyed.
1795
+ if ( ! this . vm . _isBeingDestroyed ) {
1797
1796
remove$1 ( this . vm . _watchers , this ) ;
1798
1797
}
1799
1798
var i = this . deps . length ;
@@ -1933,6 +1932,14 @@ var computedSharedDefinition = {
1933
1932
1934
1933
function initComputed ( vm , computed ) {
1935
1934
for ( var key in computed ) {
1935
+ /* istanbul ignore if */
1936
+ if ( process . env . NODE_ENV !== 'production' && key in vm ) {
1937
+ warn (
1938
+ "existing instance property \"" + key + "\" will be " +
1939
+ "overwritten by a computed property with the same name." ,
1940
+ vm
1941
+ ) ;
1942
+ }
1936
1943
var userDef = computed [ key ] ;
1937
1944
if ( typeof userDef === 'function' ) {
1938
1945
computedSharedDefinition . get = makeComputedGetter ( userDef , vm ) ;
@@ -3651,7 +3658,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
3651
3658
get : isServerRendering
3652
3659
} ) ;
3653
3660
3654
- Vue$3 . version = '2.1.7 ' ;
3661
+ Vue$3 . version = '2.1.8 ' ;
3655
3662
3656
3663
/* */
3657
3664
@@ -4478,6 +4485,8 @@ function createPatchFunction (backend) {
4478
4485
}
4479
4486
}
4480
4487
}
4488
+ } else if ( elm . data !== vnode . text ) {
4489
+ elm . data = vnode . text ;
4481
4490
}
4482
4491
return true
4483
4492
}
@@ -4489,7 +4498,7 @@ function createPatchFunction (backend) {
4489
4498
vnode . tag . toLowerCase ( ) === ( node . tagName && node . tagName . toLowerCase ( ) )
4490
4499
)
4491
4500
} else {
4492
- return _toString ( vnode . text ) === node . data
4501
+ return node . nodeType === ( vnode . isComment ? 8 : 3 )
4493
4502
}
4494
4503
}
4495
4504
@@ -5273,8 +5282,10 @@ function enter (vnode, toggleDisplay) {
5273
5282
var css = data . css ;
5274
5283
var type = data . type ;
5275
5284
var enterClass = data . enterClass ;
5285
+ var enterToClass = data . enterToClass ;
5276
5286
var enterActiveClass = data . enterActiveClass ;
5277
5287
var appearClass = data . appearClass ;
5288
+ var appearToClass = data . appearToClass ;
5278
5289
var appearActiveClass = data . appearActiveClass ;
5279
5290
var beforeEnter = data . beforeEnter ;
5280
5291
var enter = data . enter ;
@@ -5304,6 +5315,7 @@ function enter (vnode, toggleDisplay) {
5304
5315
5305
5316
var startClass = isAppear ? appearClass : enterClass ;
5306
5317
var activeClass = isAppear ? appearActiveClass : enterActiveClass ;
5318
+ var toClass = isAppear ? appearToClass : enterToClass ;
5307
5319
var beforeEnterHook = isAppear ? ( beforeAppear || beforeEnter ) : beforeEnter ;
5308
5320
var enterHook = isAppear ? ( typeof appear === 'function' ? appear : enter ) : enter ;
5309
5321
var afterEnterHook = isAppear ? ( afterAppear || afterEnter ) : afterEnter ;
@@ -5318,6 +5330,7 @@ function enter (vnode, toggleDisplay) {
5318
5330
5319
5331
var cb = el . _enterCb = once ( function ( ) {
5320
5332
if ( expectsCSS ) {
5333
+ removeTransitionClass ( el , toClass ) ;
5321
5334
removeTransitionClass ( el , activeClass ) ;
5322
5335
}
5323
5336
if ( cb . cancelled ) {
@@ -5350,9 +5363,10 @@ function enter (vnode, toggleDisplay) {
5350
5363
beforeEnterHook && beforeEnterHook ( el ) ;
5351
5364
if ( expectsCSS ) {
5352
5365
addTransitionClass ( el , startClass ) ;
5366
+ addTransitionClass ( el , activeClass ) ;
5353
5367
nextFrame ( function ( ) {
5368
+ addTransitionClass ( el , toClass ) ;
5354
5369
removeTransitionClass ( el , startClass ) ;
5355
- addTransitionClass ( el , activeClass ) ;
5356
5370
if ( ! cb . cancelled && ! userWantsControl ) {
5357
5371
whenTransitionEnds ( el , type , cb ) ;
5358
5372
}
@@ -5391,6 +5405,7 @@ function leave (vnode, rm) {
5391
5405
var css = data . css ;
5392
5406
var type = data . type ;
5393
5407
var leaveClass = data . leaveClass ;
5408
+ var leaveToClass = data . leaveToClass ;
5394
5409
var leaveActiveClass = data . leaveActiveClass ;
5395
5410
var beforeLeave = data . beforeLeave ;
5396
5411
var leave = data . leave ;
@@ -5410,6 +5425,7 @@ function leave (vnode, rm) {
5410
5425
el . parentNode . _pending [ vnode . key ] = null ;
5411
5426
}
5412
5427
if ( expectsCSS ) {
5428
+ removeTransitionClass ( el , leaveToClass ) ;
5413
5429
removeTransitionClass ( el , leaveActiveClass ) ;
5414
5430
}
5415
5431
if ( cb . cancelled ) {
@@ -5442,9 +5458,10 @@ function leave (vnode, rm) {
5442
5458
beforeLeave && beforeLeave ( el ) ;
5443
5459
if ( expectsCSS ) {
5444
5460
addTransitionClass ( el , leaveClass ) ;
5461
+ addTransitionClass ( el , leaveActiveClass ) ;
5445
5462
nextFrame ( function ( ) {
5463
+ addTransitionClass ( el , leaveToClass ) ;
5446
5464
removeTransitionClass ( el , leaveClass ) ;
5447
- addTransitionClass ( el , leaveActiveClass ) ;
5448
5465
if ( ! cb . cancelled && ! userWantsControl ) {
5449
5466
whenTransitionEnds ( el , type , cb ) ;
5450
5467
}
@@ -5479,6 +5496,9 @@ var autoCssTransition = cached(function (name) {
5479
5496
enterClass : ( name + "-enter" ) ,
5480
5497
leaveClass : ( name + "-leave" ) ,
5481
5498
appearClass : ( name + "-enter" ) ,
5499
+ enterToClass : ( name + "-enter-to" ) ,
5500
+ leaveToClass : ( name + "-leave-to" ) ,
5501
+ appearToClass : ( name + "-enter-to" ) ,
5482
5502
enterActiveClass : ( name + "-enter-active" ) ,
5483
5503
leaveActiveClass : ( name + "-leave-active" ) ,
5484
5504
appearActiveClass : ( name + "-enter-active" )
@@ -5746,10 +5766,13 @@ var transitionProps = {
5746
5766
type : String ,
5747
5767
enterClass : String ,
5748
5768
leaveClass : String ,
5769
+ enterToClass : String ,
5770
+ leaveToClass : String ,
5749
5771
enterActiveClass : String ,
5750
5772
leaveActiveClass : String ,
5751
5773
appearClass : String ,
5752
- appearActiveClass : String
5774
+ appearActiveClass : String ,
5775
+ appearToClass : String
5753
5776
} ;
5754
5777
5755
5778
// in case the child is also an abstract component, e.g. <keep-alive>
@@ -5793,6 +5816,10 @@ function hasParentTransition (vnode) {
5793
5816
}
5794
5817
}
5795
5818
5819
+ function isSameChild ( child , oldChild ) {
5820
+ return oldChild . key === child . key && oldChild . tag === child . tag
5821
+ }
5822
+
5796
5823
var Transition = {
5797
5824
name : 'transition' ,
5798
5825
props : transitionProps ,
@@ -5865,11 +5892,10 @@ var Transition = {
5865
5892
child . data . show = true ;
5866
5893
}
5867
5894
5868
- if ( oldChild && oldChild . data && oldChild . key !== key ) {
5895
+ if ( oldChild && oldChild . data && ! isSameChild ( child , oldChild ) ) {
5869
5896
// replace old child transition data with fresh one
5870
5897
// important for dynamic transitions!
5871
- var oldData = oldChild . data . transition = extend ( { } , data ) ;
5872
-
5898
+ var oldData = oldChild && ( oldChild . data . transition = extend ( { } , data ) ) ;
5873
5899
// handle transition mode
5874
5900
if ( mode === 'out-in' ) {
5875
5901
// return placeholder node and queue update when leave finishes
@@ -6080,6 +6106,15 @@ Vue$3.prototype.$mount = function (
6080
6106
return this . _mount ( el , hydrating )
6081
6107
} ;
6082
6108
6109
+ if ( process . env . NODE_ENV !== 'production' &&
6110
+ inBrowser && typeof console !== 'undefined' ) {
6111
+ console [ console . info ? 'info' : 'log' ] (
6112
+ "You are running Vue in development mode.\n" +
6113
+ "Make sure to turn on production mode when deploying for production.\n" +
6114
+ "See more tips at https://vuejs.org/guide/deployment.html"
6115
+ ) ;
6116
+ }
6117
+
6083
6118
// devtools global hook
6084
6119
/* istanbul ignore next */
6085
6120
setTimeout ( function ( ) {
@@ -6090,8 +6125,8 @@ setTimeout(function () {
6090
6125
process . env . NODE_ENV !== 'production' &&
6091
6126
inBrowser && ! isEdge && / C h r o m e \/ \d + / . test ( window . navigator . userAgent )
6092
6127
) {
6093
- console . log (
6094
- 'Download the Vue Devtools for a better development experience:\n' +
6128
+ console [ console . info ? 'info' : ' log' ] (
6129
+ 'Download the Vue Devtools extension for a better development experience:\n' +
6095
6130
'https://github.com/vuejs/vue-devtools'
6096
6131
) ;
6097
6132
}
@@ -7542,6 +7577,8 @@ function bind$2 (el, dir) {
7542
7577
} ;
7543
7578
}
7544
7579
7580
+ /* */
7581
+
7545
7582
var baseDirectives = {
7546
7583
bind : bind$2 ,
7547
7584
cloak : noop
@@ -7820,23 +7857,25 @@ function genChildren (el, checkSkip) {
7820
7857
}
7821
7858
}
7822
7859
7823
- // determine the normalzation needed for the children array.
7860
+ // determine the normalization needed for the children array.
7824
7861
// 0: no normalization needed
7825
7862
// 1: simple normalization needed (possible 1-level deep nested array)
7826
- // 2: full nomralization needed
7863
+ // 2: full normalization needed
7827
7864
function getNormalizationType ( children ) {
7865
+ var res = 0 ;
7828
7866
for ( var i = 0 ; i < children . length ; i ++ ) {
7829
7867
var el = children [ i ] ;
7830
7868
if ( needsNormalization ( el ) ||
7831
7869
( el . if && el . ifConditions . some ( function ( c ) { return needsNormalization ( c . block ) ; } ) ) ) {
7832
- return 2
7870
+ res = 2 ;
7871
+ break
7833
7872
}
7834
7873
if ( maybeComponent ( el ) ||
7835
7874
( el . if && el . ifConditions . some ( function ( c ) { return maybeComponent ( c . block ) ; } ) ) ) {
7836
- return 1
7875
+ res = 1 ;
7837
7876
}
7838
7877
}
7839
- return 0
7878
+ return res
7840
7879
}
7841
7880
7842
7881
function needsNormalization ( el ) {
@@ -8141,8 +8180,11 @@ function genCheckboxModel (
8141
8180
var falseValueBinding = getBindingAttr ( el , 'false-value' ) || 'false' ;
8142
8181
addProp ( el , 'checked' ,
8143
8182
"Array.isArray(" + value + ")" +
8144
- "?_i(" + value + "," + valueBinding + ")>-1" +
8145
- ":_q(" + value + "," + trueValueBinding + ")"
8183
+ "?_i(" + value + "," + valueBinding + ")>-1" + (
8184
+ trueValueBinding === 'true'
8185
+ ? ( ":(" + value + ")" )
8186
+ : ( ":_q(" + value + "," + trueValueBinding + ")" )
8187
+ )
8146
8188
) ;
8147
8189
addHandler ( el , 'change' ,
8148
8190
"var $$a=" + value + "," +
0 commit comments