11/*!
2- * Vue.js v2.5.2
2+ * Vue.js v2.5.3
33 * (c) 2014-2017 Evan You
44 * Released under the MIT License.
55 */
@@ -756,23 +756,29 @@ function createTextVNode (val) {
756756// multiple renders, cloning them avoids errors when DOM manipulations rely
757757// on their elm reference.
758758function cloneVNode ( vnode , deep ) {
759+ var componentOptions = vnode . componentOptions ;
759760 var cloned = new VNode (
760761 vnode . tag ,
761762 vnode . data ,
762763 vnode . children ,
763764 vnode . text ,
764765 vnode . elm ,
765766 vnode . context ,
766- vnode . componentOptions ,
767+ componentOptions ,
767768 vnode . asyncFactory
768769 ) ;
769770 cloned . ns = vnode . ns ;
770771 cloned . isStatic = vnode . isStatic ;
771772 cloned . key = vnode . key ;
772773 cloned . isComment = vnode . isComment ;
773774 cloned . isCloned = true ;
774- if ( deep && vnode . children ) {
775- cloned . children = cloneVNodes ( vnode . children ) ;
775+ if ( deep ) {
776+ if ( vnode . children ) {
777+ cloned . children = cloneVNodes ( vnode . children , true ) ;
778+ }
779+ if ( componentOptions && componentOptions . children ) {
780+ componentOptions . children = cloneVNodes ( componentOptions . children , true ) ;
781+ }
776782 }
777783 return cloned
778784}
@@ -1005,7 +1011,7 @@ function set (target, key, val) {
10051011 target . splice ( key , 1 , val ) ;
10061012 return val
10071013 }
1008- if ( hasOwn ( target , key ) ) {
1014+ if ( key in target && ! ( key in Object . prototype ) ) {
10091015 target [ key ] = val ;
10101016 return val
10111017 }
@@ -1137,7 +1143,7 @@ function mergeDataOrFn (
11371143 typeof parentVal === 'function' ? parentVal . call ( this ) : parentVal
11381144 )
11391145 }
1140- } else if ( parentVal || childVal ) {
1146+ } else {
11411147 return function mergedInstanceDataFn ( ) {
11421148 // instance merge
11431149 var instanceData = typeof childVal === 'function'
@@ -1171,7 +1177,7 @@ strats.data = function (
11711177
11721178 return parentVal
11731179 }
1174- return mergeDataOrFn . call ( this , parentVal , childVal )
1180+ return mergeDataOrFn ( parentVal , childVal )
11751181 }
11761182
11771183 return mergeDataOrFn ( parentVal , childVal , vm )
@@ -1977,6 +1983,9 @@ function updateListeners (
19771983/* */
19781984
19791985function mergeVNodeHook ( def , hookKey , hook ) {
1986+ if ( def instanceof VNode ) {
1987+ def = def . data . hook || ( def . data . hook = { } ) ;
1988+ }
19801989 var invoker ;
19811990 var oldHook = def [ hookKey ] ;
19821991
@@ -2344,6 +2353,7 @@ function updateComponentListeners (
23442353) {
23452354 target = vm ;
23462355 updateListeners ( listeners , oldListeners || { } , add , remove$1 , vm ) ;
2356+ target = undefined ;
23472357}
23482358
23492359function eventsMixin ( Vue ) {
@@ -2399,7 +2409,7 @@ function eventsMixin (Vue) {
23992409 if ( ! cbs ) {
24002410 return vm
24012411 }
2402- if ( arguments . length === 1 ) {
2412+ if ( ! fn ) {
24032413 vm . _events [ event ] = null ;
24042414 return vm
24052415 }
@@ -2461,7 +2471,6 @@ function resolveSlots (
24612471 if ( ! children ) {
24622472 return slots
24632473 }
2464- var defaultSlot = [ ] ;
24652474 for ( var i = 0 , l = children . length ; i < l ; i ++ ) {
24662475 var child = children [ i ] ;
24672476 var data = child . data ;
@@ -2482,12 +2491,14 @@ function resolveSlots (
24822491 slot . push ( child ) ;
24832492 }
24842493 } else {
2485- defaultSlot . push ( child ) ;
2494+ ( slots . default || ( slots . default = [ ] ) ) . push ( child ) ;
24862495 }
24872496 }
2488- // ignore whitespace
2489- if ( ! defaultSlot . every ( isWhitespace ) ) {
2490- slots . default = defaultSlot ;
2497+ // ignore slots that contains only whitespace
2498+ for ( var name$1 in slots ) {
2499+ if ( slots [ name$1 ] . every ( isWhitespace ) ) {
2500+ delete slots [ name$1 ] ;
2501+ }
24912502 }
24922503 return slots
24932504}
@@ -3651,6 +3662,7 @@ function renderSlot (
36513662 bindObject
36523663) {
36533664 var scopedSlotFn = this . $scopedSlots [ name ] ;
3665+ var nodes ;
36543666 if ( scopedSlotFn ) { // scoped slot
36553667 props = props || { } ;
36563668 if ( bindObject ) {
@@ -3662,19 +3674,28 @@ function renderSlot (
36623674 }
36633675 props = extend ( extend ( { } , bindObject ) , props ) ;
36643676 }
3665- return scopedSlotFn ( props ) || fallback
3677+ nodes = scopedSlotFn ( props ) || fallback ;
36663678 } else {
36673679 var slotNodes = this . $slots [ name ] ;
36683680 // warn duplicate slot usage
3669- if ( slotNodes && process . env . NODE_ENV !== 'production' ) {
3670- slotNodes . _rendered && warn (
3671- "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
3672- "- this will likely cause render errors." ,
3673- this
3674- ) ;
3681+ if ( slotNodes ) {
3682+ if ( process . env . NODE_ENV !== 'production' && slotNodes . _rendered ) {
3683+ warn (
3684+ "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
3685+ "- this will likely cause render errors." ,
3686+ this
3687+ ) ;
3688+ }
36753689 slotNodes . _rendered = true ;
36763690 }
3677- return slotNodes || fallback
3691+ nodes = slotNodes || fallback ;
3692+ }
3693+
3694+ var target = props && props . slot ;
3695+ if ( target ) {
3696+ return this . $createElement ( 'template' , { slot : target } , nodes )
3697+ } else {
3698+ return nodes
36783699 }
36793700}
36803701
@@ -4829,8 +4850,8 @@ var KeepAlive = {
48294850 // check pattern
48304851 var name = getComponentName ( componentOptions ) ;
48314852 if ( name && (
4832- ( this . include && ! matches ( this . include , name ) ) ||
4833- ( this . exclude && matches ( this . exclude , name ) )
4853+ ( this . exclude && matches ( this . exclude , name ) ) ||
4854+ ( this . include && ! matches ( this . include , name ) )
48344855 ) ) {
48354856 return vnode
48364857 }
@@ -4926,7 +4947,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
49264947 }
49274948} ) ;
49284949
4929- Vue$3 . version = '2.5.2 ' ;
4950+ Vue$3 . version = '2.5.3 ' ;
49304951
49314952/* */
49324953
@@ -5907,9 +5928,12 @@ function createPatchFunction (backend) {
59075928 // create an empty node and replace it
59085929 oldVnode = emptyNodeAt ( oldVnode ) ;
59095930 }
5931+
59105932 // replacing existing element
59115933 var oldElm = oldVnode . elm ;
59125934 var parentElm$1 = nodeOps . parentNode ( oldElm ) ;
5935+
5936+ // create new node
59135937 createElm (
59145938 vnode ,
59155939 insertedVnodeQueue ,
@@ -5920,9 +5944,8 @@ function createPatchFunction (backend) {
59205944 nodeOps . nextSibling ( oldElm )
59215945 ) ;
59225946
5947+ // update parent placeholder node element, recursively
59235948 if ( isDef ( vnode . parent ) ) {
5924- // component root element replaced.
5925- // update parent placeholder node element, recursively
59265949 var ancestor = vnode . parent ;
59275950 var patchable = isPatchable ( vnode ) ;
59285951 while ( ancestor ) {
@@ -5951,6 +5974,7 @@ function createPatchFunction (backend) {
59515974 }
59525975 }
59535976
5977+ // destroy old node
59545978 if ( isDef ( parentElm$1 ) ) {
59555979 removeVnodes ( parentElm$1 , [ oldVnode ] , 0 , 0 ) ;
59565980 } else if ( isDef ( oldVnode . tag ) ) {
@@ -6016,14 +6040,14 @@ function _update (oldVnode, vnode) {
60166040 }
60176041 } ;
60186042 if ( isCreate ) {
6019- mergeVNodeHook ( vnode . data . hook || ( vnode . data . hook = { } ) , 'insert' , callInsert ) ;
6043+ mergeVNodeHook ( vnode , 'insert' , callInsert ) ;
60206044 } else {
60216045 callInsert ( ) ;
60226046 }
60236047 }
60246048
60256049 if ( dirsWithPostpatch . length ) {
6026- mergeVNodeHook ( vnode . data . hook || ( vnode . data . hook = { } ) , 'postpatch' , function ( ) {
6050+ mergeVNodeHook ( vnode , 'postpatch' , function ( ) {
60276051 for ( var i = 0 ; i < dirsWithPostpatch . length ; i ++ ) {
60286052 callHook$1 ( dirsWithPostpatch [ i ] , 'componentUpdated' , vnode , oldVnode ) ;
60296053 }
@@ -6315,6 +6339,7 @@ function updateDOMListeners (oldVnode, vnode) {
63156339 target$1 = vnode . elm ;
63166340 normalizeEvents ( on ) ;
63176341 updateListeners ( on , oldOn , add$1 , remove$2 , vnode . context ) ;
6342+ target$1 = undefined ;
63186343}
63196344
63206345var events = {
@@ -6920,7 +6945,7 @@ function enter (vnode, toggleDisplay) {
69206945
69216946 if ( ! vnode . data . show ) {
69226947 // remove pending leave element on enter by injecting an insert hook
6923- mergeVNodeHook ( vnode . data . hook || ( vnode . data . hook = { } ) , 'insert' , function ( ) {
6948+ mergeVNodeHook ( vnode , 'insert' , function ( ) {
69246949 var parent = el . parentNode ;
69256950 var pendingNode = parent && parent . _pending && parent . _pending [ vnode . key ] ;
69266951 if ( pendingNode &&
@@ -7159,10 +7184,17 @@ if (isIE9) {
71597184 } ) ;
71607185}
71617186
7162- var model$1 = {
7163- inserted : function inserted ( el , binding , vnode ) {
7187+ var directive = {
7188+ inserted : function inserted ( el , binding , vnode , oldVnode ) {
71647189 if ( vnode . tag === 'select' ) {
7165- setSelected ( el , binding , vnode . context ) ;
7190+ // #6903
7191+ if ( oldVnode . elm && ! oldVnode . elm . _vOptions ) {
7192+ mergeVNodeHook ( vnode , 'postpatch' , function ( ) {
7193+ directive . componentUpdated ( el , binding , vnode ) ;
7194+ } ) ;
7195+ } else {
7196+ setSelected ( el , binding , vnode . context ) ;
7197+ }
71667198 el . _vOptions = [ ] . map . call ( el . options , getValue ) ;
71677199 } else if ( vnode . tag === 'textarea' || isTextInputType ( el . type ) ) {
71687200 el . _vModifiers = binding . modifiers ;
@@ -7183,6 +7215,7 @@ var model$1 = {
71837215 }
71847216 }
71857217 } ,
7218+
71867219 componentUpdated : function componentUpdated ( el , binding , vnode ) {
71877220 if ( vnode . tag === 'select' ) {
71887221 setSelected ( el , binding , vnode . context ) ;
@@ -7341,7 +7374,7 @@ var show = {
73417374} ;
73427375
73437376var platformDirectives = {
7344- model : model$1 ,
7377+ model : directive ,
73457378 show : show
73467379} ;
73477380
0 commit comments