1
1
/*!
2
- * Vue.js v2.1.0
2
+ * Vue.js v2.1.3
3
3
* (c) 2014-2016 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -1413,8 +1413,6 @@ var util = Object.freeze({
1413
1413
1414
1414
/* not type checking this file because flow doesn't play well with Proxy */
1415
1415
1416
- var hasProxy ;
1417
- var proxyHandlers ;
1418
1416
var initProxy ;
1419
1417
1420
1418
{
@@ -1425,29 +1423,47 @@ var initProxy;
1425
1423
'require' // for Webpack/Browserify
1426
1424
) ;
1427
1425
1428
- hasProxy =
1426
+ var warnNonPresent = function ( target , key ) {
1427
+ warn (
1428
+ "Property or method \"" + key + "\" is not defined on the instance but " +
1429
+ "referenced during render. Make sure to declare reactive data " +
1430
+ "properties in the data option." ,
1431
+ target
1432
+ ) ;
1433
<
8000
/td>+ } ;
1434
+
1435
+ var hasProxy =
1429
1436
typeof Proxy !== 'undefined' &&
1430
1437
Proxy . toString ( ) . match ( / n a t i v e c o d e / ) ;
1431
1438
1432
- proxyHandlers = {
1439
+ var hasHandler = {
1433
1440
has : function has ( target , key ) {
1434
1441
var has = key in target ;
1435
1442
var isAllowed = allowedGlobals ( key ) || key . charAt ( 0 ) === '_' ;
1436
1443
if ( ! has && ! isAllowed ) {
1437
- warn (
1438
- "Property or method \"" + key + "\" is not defined on the instance but " +
1439
- "referenced during render. Make sure to declare reactive data " +
1440
- "properties in the data option." ,
1441
- target
1442
- ) ;
1444
+ warnNonPresent ( target , key ) ;
1443
1445
}
1444
1446
return has || ! isAllowed
1445
1447
}
1446
1448
} ;
1447
1449
1450
+ var getHandler = {
1451
+ get : function get ( target , key ) {
1452
+ if ( typeof key === 'string' && ! ( key in target ) ) {
1453
+ warnNonPresent ( target , key ) ;
1454
+ }
1455
+ return target [ key ]
1456
+ }
1457
+ } ;
1458
+
1448
1459
initProxy = function initProxy ( vm ) {
1449
1460
if ( hasProxy ) {
1450
- vm . _renderProxy = new Proxy ( vm , proxyHandlers ) ;
1461
+ // determine which proxy handler to use
1462
+ var options = vm . $options ;
1463
+ var handlers = options . render && options . render . _withStripped
1464
+ ? getHandler
1465
+ : hasHandler ;
1466
+ vm . _renderProxy = new Proxy ( vm , handlers ) ;
1451
1467
} else {
1452
1468
vm . _renderProxy = vm ;
1453
1469
}
@@ -1796,9 +1812,9 @@ function _traverse (val, seen) {
1796
1812
function initState ( vm ) {
1797
1813
vm . _watchers = [ ] ;
1798
1814
initProps ( vm ) ;
1815
+ initMethods ( vm ) ;
1799
1816
initData ( vm ) ;
1800
1817
initComputed ( vm ) ;
1801
- initMethods ( vm ) ;
1802
1818
initWatch ( vm ) ;
1803
1819
}
1804
1820
@@ -2353,6 +2369,10 @@ function lifecycleMixin (Vue) {
2353
2369
var vm = this ;
2354
2370
var hasChildren = ! ! ( vm . $options . _renderChildren || renderChildren ) ;
2355
2371
vm . $options . _parentVnode = parentVnode ;
2372
+ vm . $vnode = parentVnode ; // update vm's placeholder node without re-render
2373
+ if ( vm . _vnode ) { // update child tree's parent
2374
+ vm . _vnode . parent = parentVnode ;
2375
+ }
2356
2376
vm . $options . _renderChildren = renderChildren ;
2357
2377
// update props
2358
2378
if ( propsData && vm . $options . props ) {
@@ -2826,7 +2846,7 @@ function initRender (vm) {
2826
2846
vm . _staticTrees = null ;
2827
2847
vm . _renderContext = vm . $options . _parentVnode && vm . $options . _parentVnode . context ;
2828
2848
vm . $slots = resolveSlots ( vm . $options . _renderChildren , vm . _renderContext ) ;
2829
- vm . $scopedSlots = null ;
2849
+ vm . $scopedSlots = { } ;
2830
2850
// bind the public createElement fn to this instance
2831
2851
// so that we get proper render context inside it.
2832
2852
vm . $createElement = bind$1 ( createElement , vm ) ;
@@ -2854,7 +2874,7 @@ function renderMixin (Vue) {
2854
2874
}
2855
2875
}
2856
2876
2857
- if ( _parentVnode ) {
2877
+ if ( _parentVnode && _parentVnode . data . scopedSlots ) {
2858
2878
vm . $scopedSlots = _parentVnode . data . scopedSlots ;
2859
2879
}
2860
2880
@@ -3000,7 +3020,7 @@ function renderMixin (Vue) {
3000
3020
fallback ,
3001
3021
props
3002
3022
) {
3003
- var scopedSlotFn = this . $scopedSlots && this . $scopedSlots [ name ] ;
3023
+ var scopedSlotFn = this . $scopedSlots [ name ] ;
3004
3024
if ( scopedSlotFn ) { // scoped slot
3005
3025
return scopedSlotFn ( props || { } ) || fallback
3006
3026
} else {
@@ -3495,7 +3515,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
3495
3515
get : isServerRendering
3496
3516
} ) ;
3497
3517
3498
- Vue$3 . version = '2.1.0 ' ;
3518
+ Vue$3 . version = '2.1.3 ' ;
3499
3519
3500
3520
/* */
3501
3521
@@ -4201,6 +4221,7 @@ function createPatchFunction (backend) {
4201
4221
vnode . key === oldVnode . key &&
4202
4222
( vnode . isCloned || vnode . isOnce ) ) {
4203
4223
vnode . elm = oldVnode . elm ;
4224
+ vnode . child = oldVnode . child ;
4204
4225
return
4205
4226
}
4206
4227
var i ;
@@ -4365,9 +4386,13 @@ function createPatchFunction (backend) {
4365
4386
createElm ( vnode , insertedVnodeQueue ) ;
4366
4387
4367
4388
// component root element replaced.
4368
- // update parent placeholder node element.
4389
+ // update parent placeholder node element, recursively
4369
4390
if ( vnode . parent ) {
4370
- vnode . parent . elm = vnode . elm ;
4391
+ var ancestor = vnode . parent ;
4392
+ while ( ancestor ) {
4393
+ ancestor . elm = vnode . elm ;
4394
+ ancestor = ancestor . parent ;
4395
+ }
4371
4396
if ( isPatchable ( vnode ) ) {
4372
4397
for ( var i = 0 ; i < cbs . create . length ; ++ i ) {
4373
4398
cbs . create [ i ] ( emptyNode , vnode . parent ) ;
@@ -5900,9 +5925,9 @@ var isSpecialTag = function (tag, isSFC, stack) {
5900
5925
if ( isScriptOrStyle ( tag ) ) {
5901
5926
return true
5902
5927
}
5903
- if ( isSFC ) {
5928
+ if ( isSFC && stack . length === 1 ) {
5904
5929
// top-level template that has no pre-processor
5905
- if ( tag === 'template' && stack . length === 1 && ! stack [ 0 ] . attrs . some ( hasLang ) ) {
5930
+ if ( tag === 'template' && ! stack [ 0 ] . attrs . some ( hasLang ) ) {
5906
5931
return false
5907
5932
} else {
5908
5933
return true
0 commit comments