1
1
/*!
2
- * Vue.js v2.3.2
2
+ * Vue.js v2.3.3
3
3
* (c) 2014-2017 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -21,6 +21,9 @@ function isTrue (v) {
21
21
return v === true
22
22
}
23
23
24
+ function isFalse ( v ) {
25
+ return v === false
26
+ }
24
27
/**
25
28
* Check if value is primitive
26
29
*/
@@ -1412,7 +1415,8 @@ function getPropDefaultValue (vm, prop, key) {
1412
1415
// return previous default value to avoid unnecessary watcher trigger
1413
1416
if ( vm && vm . $options . propsData &&
1414
1417
vm . $options . propsData [ key ] === undefined &&
1415
- vm . _props [ key ] !== undefined ) {
1418
+ vm . _props [ key ] !== undefined
1419
+ ) {
1416
1420
return vm . _props [ key ]
1417
1421
}
1418
1422
// call factory function for non-Function types
@@ -1686,6 +1690,7 @@ function cloneVNode (vnode) {
1686
1690
cloned . ns = vnode . ns ;
1687
1691
cloned . isStatic = vnode . isStatic ;
1688
1692
cloned . key = vnode . key ;
1693
+ cloned . isComment = vnode . isComment ;
1689
1694
cloned . isCloned = true ;
1690
1695
return cloned
1691
1696
}
@@ -1904,6 +1909,10 @@ function normalizeChildren (children) {
1904
1909
: undefined
1905
1910
}
1906
1911
1912
+ function isTextNode ( node ) {
1913
+ return isDef ( node ) && isDef ( node . text ) && isFalse ( node . isComment )
1914
+ }
1915
+
1907
1916
function normalizeArrayChildren ( children , nestedIndex ) {
1908
1917
var res = [ ] ;
1909
1918
var i , c , last ;
@@ -1915,18 +1924,25 @@ function normalizeArrayChildren (children, nestedIndex) {
1915
1924
if ( Array . isArray ( c ) ) {
1916
1925
res . push . apply ( res , normalizeArrayChildren ( c , ( ( nestedIndex || '' ) + "_" + i ) ) ) ;
1917
1926
} else if ( isPrimitive ( c ) ) {
1918
- if ( isDef ( last ) && isDef ( last . text ) ) {
1919
- last . text += String ( c ) ;
1927
+ if ( isTextNode ( last ) ) {
1928
+ // merge adjacent text nodes
1929
+ // this is necessary for SSR hydration because text nodes are
1930
+ // essentially merged when rendered to HTML strings
1931
+ ( last ) . text += String ( c ) ;
1920
1932
} else if ( c !== '' ) {
1921
1933
// convert primitive to vnode
1922
1934
res . push ( createTextVNode ( c ) ) ;
1923
1935
}
1924
1936
} else {
1925
- if ( isDef ( c . text ) && isDef ( last ) && isDef ( last . text ) ) {
1937
+ if ( isTextNode ( c ) && isTextNode ( last ) ) {
1938
+ // merge adjacent text nodes
1926
1939
res [ res . length - 1 ] = createTextVNode ( last . text + c . text ) ;
1927
1940
} else {
1928
1941
// default key for nested array children (likely generated by v-for)
1929
- if ( isDef ( c . tag ) && isUndef ( c . key ) && isDef ( nestedIndex ) ) {
1942
+ if ( isTrue ( children . _isVList ) &&
1943
+ isDef ( c . tag ) &&
1944
+ isUndef ( c . key ) &&
1945
+ isDef ( nestedIndex ) ) {
1930
1946
c . key = "__vlist" + nestedIndex + "_" + i + "__" ;
1931
1947
}
1932
1948
res . push ( c ) ;
@@ -2026,11 +2042,13 @@ function resolveAsyncComponent (
2026
2042
2027
2043
if ( isDef ( res . timeout ) ) {
2028
2044
setTimeout ( function ( ) {
2029
- reject (
2030
- process . env . NODE_ENV !== 'production'
2031
- ? ( "timeout (" + ( res . timeout ) + "ms)" )
2032
- : null
2033
- ) ;
2045
+ if ( isUndef ( factory . resolved ) ) {
2046
+ reject (
2047
+ process . env . NODE_ENV !== 'production'
2048
+ ? ( "timeout (" + ( res . timeout ) + "ms)" )
2049
+ : null
2050
+ ) ;
2051
+ }
2034
2052
} , res . timeout ) ;
2035
2053
}
2036
2054
}
@@ -2209,7 +2227,8 @@ function resolveSlots (
2209
2227
// named slots should only be respected if the vnode was rendered in the
2210
2228
// same context.
2211
2229
if ( ( child . context === context || child . functionalContext === context ) &&
2212
- child . data && child . data . slot != null ) {
2230
+ child . data && child . data . slot != null
2231
+ ) {
2213
2232
var name = child . data . slot ;
2214
2233
var slot = ( slots [ name ] || ( slots [ name ] = [ ] ) ) ;
2215
2234
if ( child . tag === 'template' ) {
@@ -2233,11 +2252,16 @@ function isWhitespace (node) {
2233
2252
}
2234
2253
2235
2254
function resolveScopedSlots (
2236
- fns
2255
+ fns , // see flow/vnode
2256
+ res
2237
2257
) {
2238
- var res = { } ;
2258
+ res = res || { } ;
2239
2259
for ( var i = 0 ; i < fns . length ; i ++ ) {
2240
- res [ fns [ i ] [ 0 ] ] = fns [ i ] [ 1 ] ;
2260
+ if ( Array . isArray ( fns [ i ] ) ) {
2261
+ resolveScopedSlots ( fns [ i ] , res ) ;
2262
+ } else {
2263
+ res [ fns [ i ] . key ] = fns [ i ] . fn ;
2264
+ }
2241
2265
}
2242
2266
return res
2243
2267
}
@@ -2555,7 +2579,7 @@ var index = 0;
2555
2579
* Reset the scheduler's state.
2556
2580
*/
2557
2581
function resetSchedulerState ( ) {
2558
- queue . length = activatedChildren . length = 0 ;
2582
+ index = queue . length = activatedChildren . length = 0 ;
2559
2583
has = { } ;
2560
2584
if ( process . env . NODE_ENV !== 'production' ) {
2561
2585
circular = { } ;
@@ -2665,10 +2689,10 @@ function queueWatcher (watcher) {
2665
2689
// if already flushing, splice the watcher based on its id
2666
2690
// if already past its id, it will be run next immediately.
2667
2691
var i = queue . length - 1 ;
2668
- while ( i >= 0 && queue [ i ] . id > watcher . id ) {
2692
+ while ( i > index && queue [ i ] . id > watcher . id ) {
2669
2693
i -- ;
2670
2694
}
2671
- queue . splice ( Math . max ( i , index ) + 1 , 0 , watcher ) ;
2695
+ queue . splice ( i + 1 , 0 , watcher ) ;
2672
2696
}
2673
2697
// queue the flush
2674
2698
if ( ! waiting ) {
@@ -3571,7 +3595,8 @@ function _createElement (
3571
3595
}
3572
3596
// support single function children as default scoped slot
3573
3597
if ( Array . isArray ( children ) &&
3574
- typeof children [ 0 ] === 'function' ) {
3598
+ typeof children [ 0 ] === 'function'
3599
+ ) {
3575
3600
data = data || { } ;
3576
3601
data . scopedSlots = { default : children [ 0 ] } ;
3577
3602
children . length = 0 ;
@@ -3659,6 +3684,9 @@ function renderList (
3659
3684
ret [ i ] = render ( val [ key ] , key , i ) ;
3660
3685
}
3661
3686
}
3687
+ if ( isDef ( ret ) ) {
3688
+ ( ret ) . _isVList = true ;
3689
+ }
3662
3690
return ret
3663
3691
}
3664
3692
@@ -4058,7 +4086,8 @@ function dedupe (latest, extended, sealed) {
4058
4086
4059
4087
function Vue$3 ( options ) {
4060
4088
if ( process . env . NODE_ENV !== 'production' &&
4061
- ! ( this instanceof Vue$3 ) ) {
4089
+ ! ( this instanceof Vue$3 )
4090
+ ) {
4062
4091
warn ( 'Vue is a constructor and should be called with the `new` keyword' ) ;
4063
4092
}
4064
4093
this . _init ( options ) ;
@@ -4076,7 +4105,7 @@ function initUse (Vue) {
4076
4105
Vue . use = function ( plugin ) {
4077
4106
/* istanbul ignore if */
4078
4107
if ( plugin . installed ) {
4079
- return
4108
+ return this
4080
4109
}
4081
4110
// additional parameters
4082
4111
var args = toArray ( arguments , 1 ) ;
@@ -4096,6 +4125,7 @@ function initUse (Vue) {
4096
4125
function initMixin$1 ( Vue ) {
4097
4126
Vue . mixin = function ( mixin ) {
4098
4127
this . options = mergeOptions ( this . options , mixin ) ;
4128
+ return this
4099
4129
} ;
4100
4130
}
4101
4131
@@ -4389,11 +4419,12 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
4389
4419
4390
4420
Object . defineProperty ( Vue$3 . prototype , '$ssrContext' , {
4391
4421
get : function get ( ) {
4422
+ /* istanbul ignore next */
4392
4423
return this . $vnode . ssrContext
4393
4424
}
4394
4425
} ) ;
4395
4426
4396
- Vue$3 . version = '2.3.2 ' ;
4427
+ Vue$3 . version = '2.3.3 ' ;
4397
4428
4398
4429
/* */
4399
4430
@@ -4974,8 +5005,9 @@ function createPatchFunction (backend) {
4974
5005
}
4975
5006
// for slot content they should also get the scopeId from the host instance.
4976
5007
if ( isDef ( i = activeInstance ) &&
4977
- i !== vnode . context &&
4978
- isDef ( i = i . $options . _scopeId ) ) {
5008
+ i !== vnode . context &&
5009
+ isDef ( i = i . $options . _scopeId )
5010
+ ) {
4979
5011
nodeOps . setAttribute ( vnode . elm , i , '' ) ;
4980
5012
}
4981
5013
}
@@ -5127,9 +5159,10 @@ function createPatchFunction (backend) {
5127
5159
// if the new node is not cloned it means the render functions have been
5128
5160
// reset by the hot-reload-api and we need to do a proper re-render.
5129
5161
if ( isTrue ( vnode . isStatic ) &&
5130
- isTrue ( oldVnode . isStatic ) &&
5131
- vnode . key === oldVnode . key &&
5132
- ( isTrue ( vnode . isCloned ) || isTrue ( vnode . isOnce ) ) ) {
5162
+ isTrue ( oldVnode . isStatic ) &&
5163
+ vnode . key === oldVnode . key &&
5164
+ ( isTrue ( vnode . isCloned ) || isTrue ( vnode . isOnce ) )
5165
+ ) {
5133
5166
vnode . elm = oldVnode . elm ;
5134
5167
vnode . componentInstance = oldVnode . componentInstance ;
5135
5168
return
@@ -5220,8 +5253,9 @@ function createPatchFunction (backend) {
5220
5253
// longer than the virtual children list.
5221
5254
if ( ! childrenMatch || childNode ) {
5222
5255
if ( process . env . NODE_ENV !== 'production' &&
5223
- typeof console !== 'undefined' &&
5224
- ! bailed ) {
5256
+ typeof console !== 'undefined' &&
5257
+ ! bailed
5258
+ ) {
5225
5259
bailed = true ;
5226
5260
console . warn ( 'Parent: ' , elm ) ;
5227
5261
console . warn ( 'Mismatching childNodes vs. VNodes: ' , elm . childNodes , children ) ;
@@ -5897,7 +5931,8 @@ function updateStyle (oldVnode, vnode) {
5897
5931
var oldData = oldVnode . data ;
5898
5932
5899
5933
if ( isUndef ( data . staticStyle ) && isUndef ( data . style ) &&
5900
- isUndef ( oldData . staticStyle ) && isUndef ( oldData . style ) ) {
5934
+ isUndef ( oldData . staticStyle ) && isUndef ( oldData . style )
5935
+ ) {
5901
5936
return
5902
5937
}
5903
5938
@@ -6035,12 +6070,14 @@ var animationEndEvent = 'animationend';
6035
6070
if ( hasTransition ) {
6036
6071
/* istanbul ignore if */
6037
6072
if ( window . ontransitionend === undefined &&
6038
- window . onwebkittransitionend !== undefined ) {
6073
+ window . onwebkittransitionend !== undefined
6074
+ ) {
6039
6075
transitionProp = 'WebkitTransition' ;
6040
6076
transitionEndEvent = 'webkitTransitionEnd' ;
6041
6077
}
6042
6078
if ( window . onanimationend === undefined &&
6043
- window . onwebkitanimationend !== undefined ) {
6079
+ window . onwebkitanimationend !== undefined
6080
+ ) {
6044
6081
animationProp = 'WebkitAnimation' ;
6045
6082
animationEndEvent = 'webkitAnimationEnd' ;
6046
6083
}
@@ -6280,8 +6317,9 @@ function enter (vnode, toggleDisplay) {
6280
6317
var parent = el . parentNode ;
6281
6318
var pendingNode = parent && parent . _pending && parent . _pending [ vnode . key ] ;
6282
6319
if ( pendingNode &&
6283
- pendingNode . tag === vnode . tag &&
6284
- pendingNode . elm . _leaveCb ) {
6320
+ pendingNode . tag === vnode . tag &&
6321
+ pendingNode . elm . _leaveCb
6322
+ ) {
6285
6323
pendingNode . elm . _leaveCb ( ) ;
6286
6324
}
6287
6325
enterHook && enterHook ( el , cb ) ;
@@ -6614,6 +6652,8 @@ function onCompositionStart (e) {
6614
6652
}
6615
6653
6616
6654
function onCompositionEnd ( e ) {
6655
+ // prevent triggering an input event for no reason
6656
+ if ( ! e . target . composing ) { return }
6617
6657
e . target . composing = false ;
6618
6658
trigger ( e . target , 'input' ) ;
6619
6659
}
@@ -6796,7 +6836,8 @@ var Transition = {
6796
6836
6797
6837
// warn invalid mode
6798
6838
if ( process . env . NODE_ENV !== 'production' &&
6799
- mode && mode !== 'in-out' && mode !== 'out-in' ) {
6839
+ mode && mode !== 'in-out' && mode !== 'out-in'
6840
+ ) {
6800
6841
warn (
6801
6842
'invalid <transition> mode: ' + mode ,
6802
6843
this . $parent
@@ -7080,8 +7121,9 @@ setTimeout(function () {
7080
7121
}
7081
7122
}
7082
7123
if ( process . env . NODE_ENV !== 'production' &&
7083
- config . productionTip !== false &&
7084
- inBrowser && typeof console !== 'undefined' ) {
7124
+ config . productionTip !== false &&
7125
+ inBrowser && typeof console !== 'undefined'
7126
+ ) {
7085
7127
console [ console . info ? 'info' : 'log' ] (
7086
7128
"You are running Vue in development mode.\n" +
7087
7129
"Make sure to turn on production mode when deploying for production.\n" +
0 commit comments