1
1
/**
2
- * Vue.js v0.11.7
2
+ * Vue.js v0.11.8
3
3
* (c) 2015 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -364,6 +364,10 @@ return /******/ (function(modules) { // webpackBootstrap
364
364
// attached/detached hooks on them.
365
365
this . _transCpnts = null
366
366
367
+ // props used in v-repeat diffing
368
+ this . _new = true
369
+ this . _reused = false
370
+
367
371
// merge options.
368
372
options = this . $options = mergeOptions (
369
373
this . constructor . options ,
@@ -6011,7 +6015,6 @@ return /******/ (function(modules) { // webpackBootstrap
6011
6015
/***/ function ( module , exports , __webpack_require__ ) {
6012
6016
6013
6017
var _ = __webpack_require__ ( 11 )
6014
- var config = __webpack_require__ ( 15 )
6015
6018
var isObject = _ . isObject
6016
6019
var isPlainObject = _ . isPlainObject
6017
6020
var textParser = __webpack_require__ ( 19 )
@@ -6061,7 +6064,6 @@ return /******/ (function(modules) { // webpackBootstrap
6061
6064
this . _checkParam ( 'track-by' ) ||
6062
6065
this . _checkParam ( 'trackby' ) // 0.11.0 compat
6063
6066
this . cache = Object . create ( null )
6064
- this . checkUpdateStrategy ( )
6065
6067
} ,
6066
6068
6067
6069
/**
@@ -6102,8 +6104,10 @@ return /******/ (function(modules) { // webpackBootstrap
6102
6104
var id = _ . attr ( this . el , 'component' )
6103
6105
var options = this . vm . $options
6104
6106
if ( ! id ) {
6105
- this . Ctor = _ . Vue // default constructor
6106
- this . inherit = true // inline repeats should inherit
6107
+ // default constructor
6108
+ this . Ctor = _ . Vue
6109
+ // inline repeats should inherit
6110
+ this . inherit = true
6107
6111
// important: transclude with no options, just
6108
6112
// to ensure block start and block end
6109
6113
this . template = transclude ( this . template )
@@ -6142,30 +6146,6 @@ return /******/ (function(modules) { // webpackBootstrap
6142
6146
}
6143
6147
} ,
6144
6148
6145
- /**
6146
- * Check what strategy to use for updates.
6147
- *
6148
- * If the repeat is simple enough we can use in-place
6149
- * updates which simply overwrites existing instances'
6150
- * data. This strategy reuses DOM nodes and instances
6151
- * as much as possible.
6152
- *
6153
- * There are two situations where we have to use the
6154
- * more complex but more accurate diff algorithm:
6155
- * 1. We are using components with or inside v-repeat.
6156
- * The components could have private state that needs
6157
- * to be preserved across updates.
6158
- * 2. We have transitions on the list, which requires
6159
- * precise DOM re-positioning.
6160
- */
6161
-
6162
- checkUpdateStrategy : function ( ) {
6163
- this . needDiff =
6164
- this . asComponent ||
6165
- this . el . hasAttribute ( config . prefix + 'transition' ) ||
6166
- this . template . querySelector ( '[' + config . prefix + 'component]' )
6167
- } ,
6168
-
6169
6149
/**
6170
6150
* Update.
6171
6151
* This is called whenever the Array mutates.
@@ -6181,9 +6161,7 @@ return /******/ (function(modules) { // webpackBootstrap
6181
6161
} else if ( type === 'string' ) {
6182
6162
data = _ . toArray ( data )
6183
6163
}
6184
- this . vms = this . needDiff
6185
- ? this . diff ( data , this . vms )
6186
- : this . inplaceUpdate ( data , this . vms )
6164
+ this . vms = this . diff ( data , this . vms )
6187
6165
// update v-ref
6188
6166
if ( this . refID ) {
6189
6167
this . vm . $ [ this . refID ] = this . vms
@@ -6195,43 +6173,6 @@ return /******/ (function(modules) { // webpackBootstrap
6195
6173
}
6196
6174
} ,
6197
6175
6198
- /**
6199
- * Inplace update that maximally reuses existing vm
6200
- * instances and DOM nodes by simply swapping data into
6201
- * existing vms.
6202
- *
6203
- * @param {Array } data
6204
- * @param {Array } oldVms
6205
- * @return {Array }
6206
- */
6207
-
6208
- inplaceUpdate : function ( data , oldVms ) {
6209
- oldVms = oldVms || [ ]
6210
- var vms
6211
- var dir = this
6212
- var alias = dir . arg
6213
- var converted = dir . converted
6214
- if ( data . length < oldVms . length ) {
6215
- oldVms . slice ( data . length ) . forEach ( function ( vm ) {
6216
- vm . $destroy ( true )
6217
- } )
6218
- vms = oldVms . slice ( 0 , data . length )
6219
- overwrite ( data , vms , alias , converted )
6220
- } else if ( data . length > oldVms . length ) {
6221
- var newVms = data . slice ( oldVms . length ) . map ( function ( data , i ) {
6222
- var vm = dir . build ( data , i + oldVms . length )
6223
- vm . $before ( dir . ref )
6224
- return vm
6225
- } )
6226
- overwrite ( data . slice ( 0 , oldVms . length ) , oldVms , alias , converted )
6227
- vms = oldVms . concat ( newVms )
6228
- } else {
6229
- overwrite ( data , oldVms , alias , converted )
6230
- vms = oldVms
6231
- }
6232
- return vms
6233
- } ,
6234
-
6235
6176
/**
6236
6177
* Diff, based on new data and old data, determine the
6237
6178
* minimum amount of DOM manipulations needed to make the
@@ -6440,9 +6381,7 @@ return /******/ (function(modules) { // webpackBootstrap
6440
6381
var vm
6441
6382
while ( i -- ) {
6442
6383
vm = this . vms [ i ]
6443
- if ( this . needDiff ) {
6444
- this . uncacheVm ( vm )
6445
- }
6384
+ this . uncacheVm ( vm )
6446
6385
vm . $destroy ( )
6447
6386
}
6448
6387
}
@@ -6615,35 +6554,6 @@ return /******/ (function(modules) { // webpackBootstrap
6615
6554
return ret
6616
6555
}
6617
6556
6618
- /**
6619
- * Helper function to overwrite new data Array on to
6620
- * existing vms. Used in `inplaceUpdate`.
6621
- *
6622
- * @param {Array } arr
6623
- * @param {Array } vms
6624
- * @param {String|undefined } alias
6625
- * @param {Boolean } converted
6626
- */
6627
-
6628
- function overwrite ( arr , vms , alias , converted ) {
6629
- var vm , data , raw
6630
- for ( var i = 0 , l = arr . length ; i < l ; i ++ ) {
6631
- vm = vms [ i ]
6632
- data = raw = arr [ i ]
6633
- if ( converted ) {
6634
- vm . $key = data . $key
6635
- raw = data . $value
6636
- }
6637
- if ( alias ) {
6638
- vm [ alias ] = raw
6639
- } else if ( ! isObject ( raw ) ) {
6640
- vm . $value = raw
6641
- } else {
6642
- vm . _setData ( raw )
6643
- }
6644
- }
6645
- }
6646
-
6647
6557
/***/ } ,
6648
6558
/* 45 */
6649
6559
/***/ function ( module , exports , __webpack_require__ ) {
0 commit comments