1
1
/*!
2
- * Vue.js v1.0.7
2
+ * Vue.js v1.0.8
3
3
* (c) 2015 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -146,7 +146,7 @@ return /******/ (function(modules) { // webpackBootstrap
146
146
extend ( p , __webpack_require__ ( 65 ) )
147
147
extend ( p , __webpack_require__ ( 66 ) )
148
148
149
- Vue . version = '1.0.7 '
149
+ Vue . version = '1.0.8 '
150
150
module . exports = _ . Vue = Vue
151
151
152
152
/* istanbul ignore if */
@@ -950,9 +950,11 @@ return /******/ (function(modules) { // webpackBootstrap
950
950
*/
951
951
952
952
exports . createAnchor = function ( content , persist ) {
953
- return config . debug
953
+ var anchor = config . debug
954
954
? document . createComment ( content )
955
955
: document . createTextNode ( persist ? ' ' : '' )
956
+ anchor . __vue_anchor = true
957
+ return anchor
956
958
}
957
959
958
960
/**
@@ -969,7 +971,6 @@ return /******/ (function(modules) { // webpackBootstrap
969
971
for ( var i = 0 , l = attrs . length ; i < l ; i ++ ) {
970
972
var name = attrs [ i ] . name
971
973
if ( refRE . test ( name ) ) {
972
- node . removeAttribute ( name )
973
974
return _ . camelize ( name . replace ( refRE , '' ) )
974
975
}
975
976
}
@@ -1063,6 +1064,14 @@ return /******/ (function(modules) { // webpackBootstrap
1063
1064
1064
1065
warnExpressionErrors : true ,
1065
1066
1067
+ /**
1068
+ * Whether or not to handle fully object properties which
1069
+ * are already backed by getters and seters. Depending on
1070
+ * use case and environment, this might introduce non-neglible
1071
+ * performance penalties.
1072
+ */
1073
+ convertAllProperties : false ,
1074
+
1066
1075
/**
1067
1076
* Internal flag to indicate the delimiters have been
1068
1077
* changed.
@@ -1899,18 +1908,23 @@ return /******/ (function(modules) { // webpackBootstrap
1899
1908
1900
1909
function guardProps ( options ) {
1901
1910
var props = options . props
1902
- var i
1911
+ var i , val
1903
1912
if ( _ . isArray ( props ) ) {
1904
1913
options . props = { }
1905
1914
i = props . length
1906
1915
while ( i -- ) {
1907
- options . props [ props [ i ] ] = null
1916
+ val = props [ i ]
1917
+ if ( typeof val === 'string' ) {
1918
+ options . props [ val ] = null
1919
+ } else if ( val . name ) {
1920
+ options . props [ val . name ] = val
1921
+ }
1908
1922
}
1909
1923
} else if ( _ . isPlainObject ( props ) ) {
1910
1924
var keys = Object . keys ( props )
1911
1925
i = keys . length
1912
1926
while ( i -- ) {
1913
- var val = props [ keys [ i ] ]
1927
+ val = props [ keys [ i ] ]
1914
1928
if ( typeof val === 'function' ) {
1915
1929
props [ keys [ i ] ] = { type : val }
1916
1930
}
@@ -2723,10 +2737,27 @@ return /******/ (function(modules) { // webpackBootstrap
2723
2737
*/
2724
2738
2725
2739
function compileTextNode ( node , options ) {
2726
- var tokens = textParser . parse ( node . data )
2740
+ // skip marked text nodes
2741
+ if ( node . _skip ) {
2742
+ return removeText
2743
+ }
2744
+
2745
+ var tokens = textParser . parse ( node . wholeText )
2727
2746
if ( ! tokens ) {
2728
2747
return null
2729
2748
}
2749
+
2750
+ // mark adjacent text nodes as skipped,
2751
+ // because we are using node.wholeText to compile
2752
+ // all adjacent text nodes together. This fixes
2753
+ // issues in IE where sometimes it splits up a single
2754
+ // text node into multiple ones.
2755
+ var next = node . nextSibling
2756
+ while ( next && next . nodeType === 3 ) {
2757
+ next . _skip = true
2758
+ next = next . nextSibling
2759
+ }
2760
+
2730
2761
var frag = document . createDocumentFragment ( )
2731
2762
var el , token
2732
2763
for ( var i = 0 , l = tokens . length ; i < l ; i ++ ) {
@@ -2739,6 +2770,17 @@ return /******/ (function(modules) { // webpackBootstrap
2739
2770
return makeTextNodeLinkFn ( tokens , frag , options )
2740
2771
}
2741
2772
2773
+ /**
2774
+ * Linker for an skipped text node.
2775
+ *
2776
+ * @param {Vue } vm
2777
+ * @param {Text } node
2778
+ */
2779
+
2780
+ function removeText ( vm , node ) {
2781
+ _ . remove ( node )
2782
+ }
2783
+
2742
2784
/**
2743
2785
* Process a single text token.
2744
2786
*
@@ -4217,7 +4259,10 @@ return /******/ (function(modules) { // webpackBootstrap
4217
4259
parentFrag . childFrags . push ( this )
4218
4260
}
4219
4261
this . unlink = linker ( vm , frag , host , scope , this )
4220
- var single = this . single = frag . childNodes . length === 1
4262
+ var single = this . single =
4263
+ frag . childNodes . length === 1 &&
4264
+ // do not go single mode if the only node is an anchor
4265
+ ! ( frag . childNodes [ 0 ] . __vue_anchor )
4221
4266
if ( single ) {
4222
4267
this . node = frag . childNodes [ 0 ]
4223
4268
this . before = singleBefore
@@ -4474,15 +4519,9 @@ return /******/ (function(modules) { // webpackBootstrap
4474
4519
} ,
4475
4520
4476
4521
apply : function ( el , value ) {
4477
- function done ( ) {
4522
+ transition . apply ( el , value ? 1 : - 1 , function ( ) {
4478
4523
el . style . display = value ? '' : 'none'
4479
- }
4480
- // do not apply transition if not in doc
4481
- if ( _ . inDoc ( el ) ) {
4482
- transition . apply ( el , value ? 1 : - 1 , done , this . vm )
4483
- } else {
4484
- done ( )
4485
- }
4524
+ } , this . vm )
4486
4525
}
4487
4526
}
4488
4527
@@ -4961,11 +5000,17 @@ return /******/ (function(modules) { // webpackBootstrap
4961
5000
4962
5001
function keyFilter ( handler , keys ) {
4963
5002
var codes = keys . map ( function ( key ) {
4964
- var code = keyCodes [ key ]
4965
- if ( ! code ) {
4966
- code = parseInt ( key , 10 )
5003
+ var charCode = key . charCodeAt ( 0 )
5004
+ if ( charCode > 47 && charCode < 58 ) {
5005
+ return parseInt ( key , 10 )
5006
+ }
5007
+ if ( key . length === 1 ) {
5008
+ charCode = key . toUpperCase ( ) . charCodeAt ( 0 )
5009
+ if ( charCode > 64 && charCode < 91 ) {
5010
+ return charCode
5011
+ }
4967
5012
}
4968
- return code
5013
+ return keyCodes [ key ]
4969
5014
} )
4970
5015
return function keyHandler ( e ) {
4971
5016
if ( codes . indexOf ( e . keyCode ) > - 1 ) {
@@ -5040,13 +5085,8 @@ return /******/ (function(modules) { // webpackBootstrap
5040
5085
}
5041
5086
5042
5087
this . reset ( )
5043
- var scope = this . _scope || this . vm
5044
- this . handler = function ( e ) {
5045
- scope . $event = e
5046
- var res = handler ( e )
5047
- scope . $event = null
5048
- return res
5049
- }
5088
+ this . handler = handler
5089
+
5050
5090
if ( this . iframeBind ) {
5051
5091
this . iframeBind ( )
5052
5092
} else {
@@ -5510,8 +5550,15 @@ return /******/ (function(modules) { // webpackBootstrap
5510
5550
// create a ref anchor
5511
5551
this . anchor = _ . createAnchor ( 'v-component' )
5512
5552
_ . replace ( this . el , this . anchor )
5513
- // remove is attribute
5553
+ // remove is attribute.
5554
+ // this is removed during compilation, but because compilation is
5555
+ // cached, when the component is used elsewhere this attribute
5556
+ // will remain at link time.
5514
5557
this . el . removeAttribute ( 'is' )
5558
+ // remove ref, same as above
5559
+ if ( this . descriptor . ref ) {
5560
+ this . el . removeAttribute ( 'v-ref:' + _ . hyphenate ( this . descriptor . ref ) )
5561
+ }
5515
5562
// if static, build right now.
5516
5563
if ( this . literal ) {
5517
5564
this . setComponent ( this . expression )
@@ -6035,31 +6082,24 @@ return /******/ (function(modules) { // webpackBootstrap
6035
6082
}
6036
6083
// two-way sync for v-for alias
6037
6084
var forContext = scope . $forContext
6038
- if ( true ) {
6039
- if (
6040
- forContext &&
6041
- forContext . filters &&
6042
- ( new RegExp ( forContext . alias + '\\b' ) ) . test ( this . expression )
6043
- ) {
6044
- _ . warn (
6085
+ if ( forContext && forContext . alias === this . expression ) {
6086
+ if ( forContext . filters ) {
6087
+ ( "development" ) !== 'production' && _ . warn (
6045
6088
'It seems you are using two-way binding on ' +
6046
6089
'a v-for alias (' + this . expression + '), and the ' +
6047
6090
'v-for has filters. This will not work properly. ' +
6048
6091
'Either remove the filters or use an array of ' +
6049
6092
'objects and bind to object properties instead.'
6050
6093
)
6094
+ return
6051
6095
}
6052
- }
6053
- if (
6054
- forContext &&
6055
- forContext . alias === this . expression &&
6056
- ! forContext . filters
6057
- ) {
6058
- if ( scope . $key ) { // original is an object
6059
- forContext . rawValue [ scope . $key ] = value
6060
- } else {
6061
- forContext . rawValue . $set ( scope . $index , value )
6062
- }
6096
+ forContext . _withLock ( function ( ) {
6097
+ if ( scope . $key ) { // original is an object
6098
+ forContext . rawValue [ scope . $key ] = value
6099
+ } else {
6100
+ forContext . rawValue . $set ( scope . $index , value )
6101
+ }
6102
+ } )
6063
6103
}
6064
6104
}
6065
6105
@@ -7435,8 +7475,8 @@ return /******/ (function(modules) { // webpackBootstrap
7435
7475
7436
7476
function isHidden ( el ) {
7437
7477
return ! (
7438
- el . offsetWidth &&
7439
- el . offsetHeight &&
7478
+ el . offsetWidth ||
7479
+ el . offsetHeight ||
7440
7480
el . getClientRects ( ) . length
7441
7481
)
7442
7482
}
@@ -8660,7 +8700,7 @@ return /******/ (function(modules) { // webpackBootstrap
8660
8700
}
8661
8701
8662
8702
/**
8663
- * Swap the isntance 's $data. Called in $data's setter.
8703
+ * Swap the instance 's $data. Called in $data's setter.
8664
8704
*
8665
8705
* @param {Object } newData
8666
8706
*/
@@ -8826,6 +8866,7 @@ return /******/ (function(modules) { // webpackBootstrap
8826
8866
/***/ function ( module , exports , __webpack_require__ ) {
8827
8867
8828
8868
var _ = __webpack_require__ ( 1 )
8869
+ var config = __webpack_require__ ( 5 )
8829
8870
var Dep = __webpack_require__ ( 41 )
8830
8871
var arrayMethods = __webpack_require__ ( 59 )
8831
8872
var arrayKeys = Object . getOwnPropertyNames ( arrayMethods )
@@ -8874,7 +8915,7 @@ return /******/ (function(modules) { // webpackBootstrap
8874
8915
}
8875
8916
var ob
8876
8917
if (
8877
- value . hasOwnProperty ( '__ob__' ) &&
8918
+ Object . prototype . hasOwnProperty . call ( value , '__ob__' ) &&
8878
8919
value . __ob__ instanceof Observer
8879
8920
) {
8880
8921
ob = value . __ob__
@@ -8999,28 +9040,48 @@ return /******/ (function(modules) { // webpackBootstrap
8999
9040
9000
9041
function defineReactive ( obj , key , val ) {
9001
9042
var dep = new Dep ( )
9043
+
9044
+ // cater for pre-defined getter/setters
9045
+ var getter , setter
9046
+ if ( config . convertAllProperties ) {
9047
+ var property = Object . getOwnPropertyDescriptor ( obj , key )
9048
+ if ( property && property . configurable === false ) {
9049
+ return
9050
+ }
9051
+ getter = property && property . get
9052
+ setter = property && property . set
9053
+ }
9054
+
9002
9055
var childOb = Observer . create ( val )
9003
9056
Object . defineProperty ( obj , key , {
9004
9057
enumerable : true ,
9005
9058
configurable : true ,
9006
- get : function metaGetter ( ) {
9059
+ get : function reactiveGetter ( ) {
9060
+ var value = getter ? getter . call ( obj ) : val
9007
9061
if ( Dep . target ) {
9008
9062
dep . depend ( )
9009
9063
if ( childOb ) {
9010
9064
childOb . dep . depend ( )
9011
9065
}
9012
- if ( _ . isArray ( val ) ) {
9013
- for ( var e , i = 0 , l = val . length ; i < l ; i ++ ) {
9014
- e = val [ i ]
9066
+ if ( _ . isArray ( value ) ) {
9067
+ for ( var e , i = 0 , l = value . length ; i < l ; i ++ ) {
9068
+ e = value [ i ]
9015
9069
e && e . __ob__ && e . __ob__ . dep . depend ( )
9016
9070
}
9017
9071
}
9018
9072
}
9019
- return val
9073
+ return value
9020
9074
} ,
9021
- set : function metaSetter ( newVal ) {
9022
- if ( newVal === val ) return
9023
- val = newVal
9075
+ set : function reactiveSetter ( newVal ) {
9076
+ var value = getter ? getter . call ( obj ) : val
9077
+ if ( newVal === value ) {
9078
+ return
9079
+ }
9080
+ if ( setter ) {
9081
+ setter . call ( obj , newVal )
9082
+ } else {
9083
+ val = newVal
9084
+ }
9024
9085
childOb = Observer . create ( newVal )
9025
9086
dep . notify ( )
9026
9087
}
@@ -9595,8 +9656,10 @@ return /******/ (function(modules) { // webpackBootstrap
9595
9656
) {
9596
9657
var fn = expParser . parse ( expression ) . get
9597
9658
var scope = this . _scope || this . vm
9598
- var handler = function ( ) {
9659
+ var handler = function ( e ) {
9660
+ scope . $event = e
9599
9661
fn . call ( scope , scope )
9662
+ scope . $event = null
9600
9663
}
9601
9664
if ( this . filters ) {
9602
9665
handler = scope . _applyFilters ( handler , null , this . filters )
0 commit comments