1
1
/*!
2
- * Vue.js v0.12.12
2
+ * Vue.js v0.12.13
3
3
* (c) 2015 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -362,8 +362,9 @@ return /******/ (function(modules) { // webpackBootstrap
362
362
*/
363
363
364
364
var toString = Object . prototype . toString
365
+ var OBJECT_STRING = '[object Object]'
365
366
exports . isPlainObject = function ( obj ) {
366
- return toString . call ( obj ) === '[object Object]'
367
+ return toString . call ( obj ) === OBJECT_STRING
367
368
}
368
369
369
370
/**
@@ -434,7 +435,8 @@ return /******/ (function(modules) { // webpackBootstrap
434
435
*/
435
436
436
437
exports . indexOf = function ( arr , obj ) {
437
- for ( var i = 0 , l = arr . length ; i < l ; i ++ ) {
438
+ var i = arr . length
439
+ while ( i -- ) {
438
440
if ( arr [ i ] === obj ) return i
439
441
}
440
442
return - 1
@@ -3153,8 +3155,8 @@ return /******/ (function(modules) { // webpackBootstrap
3153
3155
'Error when evaluating expression "' +
3154
3156
this . expression + '". ' +
3155
3157
( config . debug
3156
- ? '' :
3157
- 'Turn on debug mode to see stack trace.'
3158
+ ? ''
3159
+ : 'Turn on debug mode to see stack trace.'
3158
3160
) , e
3159
3161
)
3160
3162
}
@@ -5589,6 +5591,7 @@ return /******/ (function(modules) { // webpackBootstrap
5589
5591
this . op =
5590
5592
this . cb = null
5591
5593
this . justEntered = false
5594
+ this . entered = this . left = false
5592
5595
this . typeCache = { }
5593
5596
// bind
5594
5597
var self = this
@@ -5631,7 +5634,11 @@ return /******/ (function(modules) { // webpackBootstrap
5631
5634
this . cb = cb
5632
5635
addClass ( this . el , this . enterClass )
5633
5636
op ( )
5637
+ this . entered = false
5634
5638
this . callHookWithCb ( 'enter' )
5639
+ if ( this . entered ) {
5640
+ return // user called done synchronously.
5641
+ }
5635
5642
this . cancel = this . hooks && this . hooks . enterCancelled
5636
5643
queue . push ( this . enterNextTick )
5637
5644
}
@@ -5647,16 +5654,20 @@ return /******/ (function(modules) { // webpackBootstrap
5647
5654
_ . nextTick ( function ( ) {
5648
5655
this . justEntered = false
5649
5656
} , this )
5650
- var type = this . getCssTransitionType ( this . enterClass )
5651
5657
var enterDone = this . enterDone
5652
- if ( type === TYPE_TRANSITION ) {
5653
- // trigger transition by removing enter class now
5658
+ var type = this . getCssTransitionType ( this . enterClass )
5659
+ if ( ! this . pendingJsCb ) {
5660
+ if ( type === TYPE_TRANSITION ) {
5661
+ // trigger transition by removing enter class now
5662
+ removeClass ( this . el , this . enterClass )
5663
+ this . setupCssCb ( transitionEndEvent , enterDone )
5664
+ } else if ( type === TYPE_ANIMATION ) {
5665
+ this . setupCssCb ( animationEndEvent , enterDone )
5666
+ } else {
5667
+ enterDone ( )
5668
+ }
5669
+ } else if ( type === TYPE_TRANSITION ) {
5654
5670
removeClass ( this . el , this . enterClass )
5655
- this . setupCssCb ( transitionEndEvent , enterDone )
5656
- } else if ( type === TYPE_ANIMATION ) {
5657
- this . setupCssCb ( animationEndEvent , enterDone )
5658
- } else if ( ! this . pendingJsCb ) {
5659
- enterDone ( )
5660
5671
}
5661
5672
}
5662
5673
@@ -5665,6 +5676,7 @@ return /******/ (function(modules) { // webpackBootstrap
5665
5676
*/
5666
5677
5667
5678
p . enterDone = function ( ) {
5679
+ this . entered = true
5668
5680
this . cancel = this . pendingJsCb = null
5669
5681
removeClass ( this . el , this . enterClass )
5670
5682
this . callHook ( 'afterEnter' )
@@ -5698,7 +5710,11 @@ return /******/ (function(modules) { // webpackBootstrap
5698
5710
this . op = op
5699
5711
this . cb = cb
5700
5712
addClass ( this . el , this . leaveClass )
5713
+ this . left = false
5701
5714
this . callHookWithCb ( 'leave' )
5715
+ if ( this . left ) {
5716
+ return // user called done synchronously.
5717
+ }
5702
5718
this . cancel = this . hooks && this . hooks . leaveCancelled
5703
5719
// only need to handle leaveDone if
5704
5720
// 1. the transition is already done (synchronously called
@@ -5737,6 +5753,7 @@ return /******/ (function(modules) { // webpackBootstrap
5737
5753
*/
5738
5754
5739
5755
p . leaveDone = function ( ) {
5756
+ this . left = true
5740
5757
this . cancel = this . pendingJsCb = null
5741
5758
this . op ( )
5742
5759
removeClass ( this . el , this . leaveClass )
@@ -6040,9 +6057,10 @@ return /******/ (function(modules) { // webpackBootstrap
6040
6057
)
6041
6058
return
6042
6059
}
6060
+ el . __v_model = this
6043
6061
handler . bind . call ( this )
6044
6062
this . update = handler . update
6045
- this . unbind = handler . unbind
6063
+ this . _unbind = handler . unbind
6046
6064
} ,
6047
6065
6048
6066
/**
@@ -6062,6 +6080,11 @@ return /******/ (function(modules) { // webpackBootstrap
6062
6080
this . hasWrite = true
6063
6081
}
6064
6082
}
6083
+ } ,
6084
+
6085
+ unbind : function ( ) {
6086
+ this . el . __v_model = null
6087
+ this . _unbind && this . _unbind ( )
6065
6088
}
6066
6089
}
6067
6090
@@ -6550,6 +6573,21 @@ return /******/ (function(modules) { // webpackBootstrap
6550
6573
*/
6551
6574
6552
6575
bind : function ( ) {
6576
+
6577
+ // some helpful tips...
6578
+ /* istanbul ignore if */
6579
+ if (
6580
+ ( "development" ) !== 'production' &&
6581
+ this . el . tagName === 'OPTION' &&
6582
+ this . el . parentNode && this . el . parentNode . __v_model
6583
+ ) {
6584
+ _ . warn (
6585
+ 'Don\'t use v-repeat for v-model options; ' +
6586
+ 'use the `options` param instead: ' +
6587
+ 'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
6588
+ )
6589
+ }
6590
+
6553
6591
// support for item in array syntax
6554
6592
var inMatch = this . expression . match ( / ( .* ) i n ( .* ) / )
6555
6593
if ( inMatch ) {
@@ -6588,19 +6626,6 @@ return /******/ (function(modules) { // webpackBootstrap
6588
6626
6589
6627
// create cache object
6590
6628
this . cache = Object . create ( null )
6591
-
6592
- // some helpful tips...
6593
- /* istanbul ignore if */
6594
- if (
6595
- ( "development" ) !== 'production' &&
6596
- this . el . tagName === 'OPTION'
6597
- ) {
6598
- _ . warn (
6599
- 'Don\'t use v-repeat for v-model options; ' +
6600
- 'use the `options` param instead: ' +
6601
- 'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
6602
- )
6603
- }
6604
6629
} ,
6605
6630
6606
6631
/**
@@ -6719,6 +6744,12 @@ return /******/ (function(modules) { // webpackBootstrap
6719
6744
*/
6720
6745
6721
6746
update : function ( data ) {
6747
+ if ( ( "development" ) !== 'production' && ! _ . isArray ( data ) ) {
6748
+ _ . warn (
6749
+ 'v-repeat pre-converts Objects into Arrays, and ' +
6750
+ 'v-repeat filters should always return Arrays.'
6751
+ )
6752
+ }
6722
6753
if ( this . componentId ) {
6723
6754
var state = this . componentState
6724
6755
if ( state === UNRESOLVED ) {
@@ -6792,6 +6823,14 @@ return /******/ (function(modules) { // webpackBootstrap
6792
6823
primitive = ! isObject ( raw )
6793
6824
vm = ! init && this . getVm ( raw , i , converted ? obj . $key : null )
6794
6825
if ( vm ) { // reusable instance
6826
+
6827
+ if ( ( "development" ) !== 'production' && vm . _reused ) {
6828
+ _ . warn (
6829
+ 'Duplicate objects found in v-repeat="' + this . expression + '": ' +
6830
+ JSON . stringify ( raw )
6831
+ )
6832
+ }
6833
+
6795
6834
vm . _reused = true
6796
6835
vm . $index = i // update $index
6797
6836
// update data for track-by or object repeat,
@@ -6989,7 +7028,7 @@ return /******/ (function(modules) { // webpackBootstrap
6989
7028
cache [ id ] = vm
6990
7029
} else if ( ! primitive && idKey !== '$index' ) {
6991
7030
( "development" ) !== 'production' && _ . warn (
6992
- 'Duplicate track-by key in v-repeat: ' + id
7031
+ 'Duplicate objects with the same track-by key in v-repeat: ' + id
6993
7032
)
6994
7033
}
6995
7034
} else {
@@ -6999,8 +7038,8 @@ return /******/ (function(modules) { // webpackBootstrap
6999
7038
data [ id ] = vm
7000
7039
} else {
7001
7040
( "development" ) !== 'production' && _ . warn (
7002
- 'Duplicate objects are not supported in v-repeat ' +
7003
- 'when using components or transitions.'
7041
+ 'Duplicate objects found in v-repeat="' + this . expression + '": ' +
7042
+ JSON . stringify ( data )
7004
7043
)
7005
7044
}
7006
7045
} else {
@@ -7731,6 +7770,7 @@ return /******/ (function(modules) { // webpackBootstrap
7731
7770
esc : 27 ,
7732
7771
tab : 9 ,
7733
7772
enter : 13 ,
7773
+ space : 32 ,
7734
7774
'delete' : 46 ,
7735
7775
up : 38 ,
7736
7776
left : 37 ,
@@ -8453,11 +8493,18 @@ return /******/ (function(modules) { // webpackBootstrap
8453
8493
) {
8454
8494
ob = value . __ob__
8455
8495
} else if (
8456
- _ . isObject ( value ) &&
8496
+ ( _ . isArray ( value ) || _ . isPlainObject ( value ) ) &&
8457
8497
! Object . isFrozen ( value ) &&
8458
8498
! value . _isVue
8459
8499
) {
8460
8500
ob = new Observer ( value )
8501
+ } else if ( true ) {
8502
+ if ( _ . isObject ( value ) && ! _ . isArray ( value ) && ! _ . isPlainObject ( value ) ) {
8503
+ _ . warn (
8504
+ 'Unobservable object found in data: ' +
8505
+ Object . prototype . toString . call ( value )
8506
+ )
8507
+ }
8461
8508
}
8462
8509
if ( ob && vm ) {
8463
8510
ob . addVm ( vm )
@@ -8505,7 +8552,42 @@ return /******/ (function(modules) { // webpackBootstrap
8505
8552
Observer . prototype . observeArray = function ( items ) {
8506
8553
var i = items . length
8507
8554
while ( i -- ) {
8508
- this . observe ( items [ i ] )
8555
+ var ob = this . observe ( items [ i ] )
8556
+ if ( ob ) {
8557
+ ( ob . parents || ( ob . parents = [ ] ) ) . push ( this )
8558
+ }
8559
+ }
8560
+ }
8561
+
8562
+ /**
8563
+ * Remove self from the parent list of removed objects.
8564
+ *
8565
+ * @param {Array } items
8566
+ */
8567
+
8568
+ Observer . prototype . unobserveArray = function ( items ) {
8569
+ var i = items . length
8570
+ while ( i -- ) {
8571
+ var ob = items [ i ] && items [ i ] . __ob__
8572
+ if ( ob ) {
8573
+ ob . parents . $remove ( this )
8574
+ }
8575
+ }
8576
+ }
8577
+
8578
+ /**
8579
+ * Notify self dependency, and also parent Array dependency
8580
+ * if any.
8581
+ */
8582
+
8583
+ Observer . prototype . notify = function ( ) {
8584
+ this . dep . notify ( )
8585
+ var parents = this . parents
8586
+ if ( parents ) {
8587
+ var i = parents . length
8588
+ while ( i -- ) {
8589
+ parents [ i ] . notify ( )
8590
+ }
8509
8591
}
8510
8592
}
8511
8593
@@ -8530,12 +8612,6 @@ return /******/ (function(modules) { // webpackBootstrap
8530
8612
if ( childOb ) {
8531
8613
childOb . dep . depend ( )
8532
8614
}
8533
- if ( _ . isArray ( val ) ) {
8534
- for ( var e , i = 0 , l = val . length ; i < l ; i ++ ) {
8535
- e = val [ i ]
8536
- e && e . __ob__ && e . __ob__ . dep . depend ( )
8537
- }
8538
- }
8539
8615
}
8540
8616
return val
8541
8617
} ,
@@ -8640,7 +8716,7 @@ return /******/ (function(modules) { // webpackBootstrap
8640
8716
}
8641
8717
var result = original . apply ( this , args )
8642
8718
var ob = this . __ob__
8643
- var inserted
8719
+ var inserted , removed
8644
8720
switch ( method ) {
8645
8721
case 'push' :
8646
8722
inserted = args
@@ -8650,11 +8726,17 @@ return /******/ (function(modules) { // webpackBootstrap
8650
8726
break
8651
8727
case 'splice' :
8652
8728
inserted = args . slice ( 2 )
8729
+ removed = result
8730
+ break
8731
+ case 'pop' :
8732
+ case 'shift' :
8733
+ removed = [ result ]
8653
8734
break
8654
8735
}
8655
8736
if ( inserted ) ob . observeArray ( inserted )
8737
+ if ( removed ) ob . unobserveArray ( removed )
8656
8738
// notify change
8657
- ob . dep . notify ( )
8739
+ ob . notify ( )
8658
8740
return result
8659
8741
} )
8660
8742
} )
@@ -8731,7 +8813,7 @@ return /******/ (function(modules) { // webpackBootstrap
8731
8813
return
8732
8814
}
8733
8815
ob . convert ( key , val )
8734
- ob . dep . notify ( )
8816
+ ob . notify ( )
8735
8817
if ( ob . vms ) {
8736
8818
var i = ob . vms . length
8737
8819
while ( i -- ) {
@@ -8779,7 +8861,7 @@ return /******/ (function(modules) { // webpackBootstrap
8779
8861
if ( ! ob || _ . isReserved ( key ) ) {
8780
8862
return
8781
8863
}
8782
- ob . dep . notify ( )
8864
+ ob . notify ( )
8783
8865
if ( ob . vms ) {
8784
8866
var i = ob . vms . length
8785
8867
while ( i -- ) {
@@ -9943,13 +10025,15 @@ return /******/ (function(modules) { // webpackBootstrap
9943
10025
exports . $addChild = function ( opts , BaseCtor ) {
9944
10026
BaseCtor = BaseCtor || _ . Vue
9945
10027
opts = opts || { }
9946
- var parent = this
9947
10028
var ChildVue
10029
+ var parent = this
10030
+ // transclusion context
10031
+ var context = opts . _context || parent
9948
10032
var inherit = opts . inherit !== undefined
9949
10033
? opts . inherit
9950
10034
: BaseCtor . options . inherit
9951
10035
if ( inherit ) {
9952
- var ctors = parent . _childCtors
10036
+ var ctors = context . _childCtors
9953
10037
ChildVue = ctors [ BaseCtor . cid ]
9954
10038
if ( ! ChildVue ) {
9955
10039
var optionName = BaseCtor . options . name
@@ -9963,9 +10047,7 @@ return /******/ (function(modules) { // webpackBootstrap
9963
10047
) ( )
9964
10048
ChildVue . options = BaseCtor . options
9965
10049
ChildVue . linker = BaseCtor . linker
9966
- // important: transcluded inline repeaters should
9967
- // inherit from outer scope rather than host
9968
- ChildVue . prototype = opts . _context || this
10050
+ ChildVue . prototype = context
9969
10051
ctors [ BaseCtor . cid ] = ChildVue
9970
10052
}
9971
10053
} else {
0 commit comments