1
1
/*!
2
- * Vue.js v1.0.0-alpha.8
2
+ * Vue.js v1.0.0-rc.2-migration
3
3
* (c) 2015 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -163,7 +163,7 @@ return /******/ (function(modules) { // webpackBootstrap
163
163
extend ( p , __webpack_require__ ( 69 ) )
164
164
extend ( p , __webpack_require__ ( 70 ) )
165
165
166
- Vue . version = '1.0.0-beta.3 '
166
+ Vue . version = '1.0.0-alpha.8 '
167
167
module . exports = _ . Vue = Vue
168
168
169
169
@@ -1748,6 +1748,7 @@ return /******/ (function(modules) { // webpackBootstrap
1748
1748
* Hooks and param attributes are merged as arrays.
1749
1749
*/
1750
1750
1751
+ strats . init =
1751
1752
strats . created =
1752
1753
strats . ready =
1753
1754
strats . attached =
@@ -1870,8 +1871,8 @@ return /******/ (function(modules) { // webpackBootstrap
1870
1871
}
1871
1872
def = components [ key ]
1872
1873
if ( _ . isPlainObject ( def ) ) {
1873
- def . id = def . id || key
1874
- components [ key ] = def . _Ctor || ( def . _Ctor = _ . Vue . extend ( def ) )
1874
+ def . name = def . name || key
1875
+ components [ key ] = _ . Vue . extend ( def )
1875
1876
}
1876
1877
}
1877
1878
}
@@ -1919,10 +1920,10 @@ return /******/ (function(modules) { // webpackBootstrap
1919
1920
var asset
1920
1921
while ( i -- ) {
1921
1922
asset = assets [ i ]
1922
- var id = asset . id || ( asset . options && asset . options . id )
1923
+ var id = asset . name || ( asset . options && asset . options . name )
1923
1924
if ( ! id ) {
1924
1925
( "development" ) !== 'production' && _ . warn (
1925
- 'Array-syntax assets must provide an id field.'
1926
+ 'Array-syntax assets must provide a "name" field.'
1926
1927
)
1927
1928
} else {
1928
1929
res [ id ] = asset
@@ -2264,21 +2265,21 @@ return /******/ (function(modules) { // webpackBootstrap
2264
2265
_ . warn ( '{DEPRECATION} ' + msg )
2265
2266
}
2266
2267
2267
- var newBindingSyntaxLink = ' See https://github.com/yyx990803 /vue/issues/1325 for details.'
2268
+ var newBindingSyntaxLink = ' See https://github.com/vuejs /vue/issues/1325 for details.'
2268
2269
2269
2270
_ . deprecation = {
2270
2271
2271
2272
REPEAT : function ( ) {
2272
2273
warn (
2273
2274
'v-repeat will be deprecated in favor of v-for in 1.0.0. ' +
2274
- 'See https://github.com/yyx990803 /vue/issues/1200 for details.'
2275
+ 'See https://github.com/vuejs /vue/issues/1200 for details.'
2275
2276
)
2276
2277
} ,
2277
2278
2278
2279
ADD : function ( ) {
2279
2280
warn (
2280
2281
'$add() will be deprecated in 1.0.0. Use $set() instead. ' +
2281
- 'See https://github.com/yyx990803 /vue/issues/1171 for details.'
2282
+ 'See https://github.com/vuejs /vue/issues/1171 for details.'
2282
2283
)
2283
2284
} ,
2284
2285
@@ -2299,36 +2300,36 @@ return /******/ (function(modules) { // webpackBootstrap
2299
2300
WAIT_FOR : function ( ) {
2300
2301
warn (
2301
2302
'"wait-for" will be deprecated in 1.0.0. Use `activate` hook instead. ' +
2302
- 'See https://github.com/yyx990803 /vue/issues/1169 for details.'
2303
+ 'See https://github.com/vuejs /vue/issues/1169 for details.'
2303
2304
)
2304
2305
} ,
2305
2306
2306
2307
STRICT_MODE : function ( type , id ) {
2307
2308
warn (
2308
2309
'Falling through to parent when resolving ' + type + ' with id "' + id +
2309
2310
'". Strict mode will be the default in 1.0.0. ' +
2310
- 'See https://github.com/yyx990803 /vue/issues/1170 for details.'
2311
+ 'See https://github.com/vuejs /vue/issues/1170 for details.'
2311
2312
)
2312
2313
} ,
2313
2314
2314
2315
CONTENT : function ( ) {
2315
2316
warn (
2316
2317
'<content> insertion points will be deprecated in in 1.0.0. in favor of <slot>. ' +
2317
- 'See https://github.com/yyx990803 /vue/issues/1167 for details.'
2318
+ 'See https://github.com/vuejs /vue/issues/1167 for details.'
2318
2319
)
2319
2320
} ,
2320
2321
2321
2322
DATA_AS_PROP : function ( ) {
2322
2323
warn (
2323
2324
'$data will no longer be usable as a prop in 1.0.0. ' +
2324
- 'See https://github.com/yyx990803 /vue/issues/1198 for details.'
2325
+ 'See https://github.com/vuejs /vue/issues/1198 for details.'
2325
2326
)
2326
2327
} ,
2327
2328
2328
2329
INHERIT : function ( ) {
2329
2330
warn (
2330
2331
'The "inherit" option will be deprecated in 1.0.0. ' +
2331
- 'See https://github.com/yyx990803 /vue/issues/1198 for details.'
2332
+ 'See https://github.com/vuejs /vue/issues/1198 for details.'
2332
2333
)
2333
2334
} ,
2334
2335
@@ -2357,15 +2358,15 @@ return /******/ (function(modules) { // webpackBootstrap
2357
2358
warn (
2358
2359
'v-ref will no longer take an attribute value in 1.0.0. Use "v-ref:id" syntax ' +
2359
2360
'instead. Also, refs will be registered under vm.$refs instead of vm.$. ' +
2360
- 'See https://github.com/yyx990803 /vue/issues/1292 for more details.'
2361
+ 'See https://github.com/vuejs /vue/issues/1292 for more details.'
2361
2362
)
2362
2363
} ,
2363
2364
2364
2365
V_EL : function ( ) {
2365
2366
warn (
2366
2367
'v-el will no longer take an attribute value in 1.0.0. Use "v-el:id" syntax ' +
2367
2368
'instead. Also, nodes will be registered under vm.$els instead of vm.$$. ' +
2368
- 'See https://github.com/yyx990803 /vue/issues/1292 for more details.'
2369
+ 'See https://github.com/vuejs /vue/issues/1292 for more details.'
2369
2370
)
2370
2371
} ,
2371
2372
@@ -2399,9 +2400,9 @@ return /******/ (function(modules) { // webpackBootstrap
2399
2400
2400
2401
ATTR_INVALID : function ( name ) {
2401
2402
warn (
2402
- 'Mustache interpolation found in non-native attribute "' + name + '": ' +
2403
+ 'Mustache interpolation found in vue-specific attribute "' + name + '": ' +
2403
2404
'attribute interpolation will be limited to native attributes only ' +
2404
- 'in 1.0.0. Use v-bind for custom attributes and props.'
2405
+ 'in 1.0.0. Use v-bind for vue directives and props.'
2405
2406
)
2406
2407
} ,
2407
2408
@@ -2462,7 +2463,7 @@ return /******/ (function(modules) { // webpackBootstrap
2462
2463
warn (
2463
2464
'No need to return false in handler for event "' + event + '": events ' +
2464
2465
'no longer propagate beyond the first triggered handler unless the ' +
2465
- 'handler explicitly returns true. See https://github.com/yyx990803 /vue/issues/1175 ' +
2466
+ 'handler explicitly returns true. See https://github.com/vuejs /vue/issues/1175 ' +
2466
2467
'for more details.'
2467
2468
)
2468
2469
} ,
@@ -2477,7 +2478,7 @@ return /******/ (function(modules) { // webpackBootstrap
2477
2478
SELECT_OPTIONS : function ( ) {
2478
2479
warn (
2479
2480
'The "options" param for <select v-model> will be deprecated in 1.0.0. ' +
2480
- 'Use v-for to render the options. See https://github.com/yyx990803 /vue/issues/1229 ' +
2481
+ 'Use v-for to render the options. See https://github.com/vuejs /vue/issues/1229 ' +
2481
2482
'for more details.'
2482
2483
)
2483
2484
} ,
@@ -2508,7 +2509,7 @@ return /******/ (function(modules) { // webpackBootstrap
2508
2509
V_COMPONENT : function ( ) {
2509
2510
warn (
2510
2511
'v-component will be deprecated in 1.0.0. Use "is" attribute instead. ' +
2511
- 'See https://github.com/yyx990803 /vue/issues/1278 for more details.'
2512
+ 'See https://github.com/vuejs /vue/issues/1278 for more details.'
2512
2513
)
2513
2514
} ,
2514
2515
@@ -2593,6 +2594,10 @@ return /******/ (function(modules) { // webpackBootstrap
2593
2594
exports . extend = function ( extendOptions ) {
2594
2595
extendOptions = extendOptions || { }
2595
2596
var Super = this
2597
+ var isFirstExtend = Super . cid === 0
2598
+ if ( isFirstExtend && extendOptions . _Ctor ) {
2599
+ return extendOptions . _Ctor
2600
+ }
2596
2601
var name = extendOptions . name || Super . options . name
2597
2602
var Sub = createClass ( name || 'VueComponent' )
2598
2603
Sub . prototype = Object . create ( Super . prototype )
@@ -2614,6 +2619,10 @@ return /******/ (function(modules) { // webpackBootstrap
2614
2619
if ( name ) {
2615
2620
Sub . options . components [ name ] = Sub
2616
2621
}
2622
+ // cache constructor
2623
+ if ( isFirstExtend ) {
2624
+ extendOptions . _Ctor = Sub
2625
+ }
2617
2626
return Sub
2618
2627
}
2619
2628
@@ -2889,10 +2898,11 @@ return /******/ (function(modules) { // webpackBootstrap
2889
2898
* @param {Vue } vm
2890
2899
* @param {Element } el
2891
2900
* @param {Object } options
2901
+ * @param {Object } contextOptions
2892
2902
* @return {Function }
2893
2903
*/
2894
2904
2895
- exports . compileRoot = function ( el , options ) {
2905
+ exports . compileRoot = function ( el , options , contextOptions ) {
2896
2906
var containerAttrs = options . _containerAttrs
2897
2907
var replacerAttrs = options . _replacerAttrs
2898
2908
var contextLinkFn , replacerLinkFn
@@ -2904,8 +2914,8 @@ return /******/ (function(modules) { // webpackBootstrap
2904
2914
// compiled separately and linked in different scopes.
2905
2915
if ( options . _asComponent ) {
2906
2916
// 2. container attributes
2907
- if ( containerAttrs ) {
2908
- contextLinkFn = compileDirectives ( containerAttrs , options )
2917
+ if ( containerAttrs && contextOptions ) {
2918
+ contextLinkFn = compileDirectives ( containerAttrs , contextOptions )
2909
2919
}
2910
2920
if ( replacerAttrs ) {
2911
2921
// 3. replacer attributes
@@ -3599,7 +3609,7 @@ return /******/ (function(modules) { // webpackBootstrap
3599
3609
prop . filters = parsed . filters
3600
3610
// check literal
3601
3611
if ( literalValueRE . test ( value ) ) {
3602
- prop . mode = propBindingModes . ONE_TIME
3612
+ prop . raw = _ . stripQuotes ( value ) || value
3603
3613
} else {
3604
3614
prop . dynamic = true
3605
3615
// check non-settable path for two-way bindings
@@ -3821,7 +3831,7 @@ return /******/ (function(modules) { // webpackBootstrap
3821
3831
inSingle = inDouble = false
3822
3832
curly = square = paren = 0
3823
3833
lastFilterIndex = 0
3824
- dir = { }
3834
+ dir = { raw : s }
3825
3835
3826
3836
for ( i = 0 , l = str . length ; i < l ; i ++ ) {
3827
3837
c = str . charCodeAt ( i )
@@ -6090,33 +6100,36 @@ return /******/ (function(modules) { // webpackBootstrap
6090
6100
6091
6101
/**
6092
6102
* Remove fragment, single node version
6103
+ *
6104
+ * @param {Boolean } [destroy]
6093
6105
*/
6094
6106
6095
- function singleRemove ( ) {
6107
+ function singleRemove ( destroy ) {
6096
6108
var shouldCallRemove = _ . inDoc ( this . node )
6097
- transition . remove ( this . node , this . vm )
6098
- this . inserted = false
6099
- if ( shouldCallRemove ) {
6100
- this . callHook ( detach )
6101
- }
6109
+ var self = this
6110
+ transition . remove ( this . node , this . vm , function ( ) {
6111
+ self . inserted = false
6112
+ if ( shouldCallRemove ) {
6113
+ self . callHook ( detach )
6114
+ }
6115
+ if ( destroy ) {
6116
+ self . destroy ( )
6117
+ }
6118
+ } )
6102
6119
}
6103
6120
6104
6121
/**
6105
6122
* Insert fragment before target, multi-nodes version
6106
6123
*
6107
6124
* @param {Node } target
6108
- * @param {Boolean } trans
6109
6125
*/
6110
6126
6111
- function multiBefore ( target , trans ) {
6127
+ function multiBefore ( target ) {
6112
6128
_ . before ( this . node , target )
6113
6129
var nodes = this . nodes
6114
6130
var vm = this . vm
6115
- var method = trans !== false
6116
- ? transition . before
6117
- : _ . before
6118
6131
for ( var i = 0 , l = nodes . length ; i < l ; i ++ ) {
6119
- method ( nodes [ i ] , target , vm )
6132
+ _ . before ( nodes [ i ] , target , vm )
6120
6133
}
6121
6134
_ . before ( this . end , target )
6122
6135
this . inserted = true
@@ -6127,9 +6140,11 @@ return /******/ (function(modules) { // webpackBootstrap
6127
6140
6128
6141
/**
6129
6142
* Remove fragment, multi-nodes version
6143
+ *
6144
+ * @param {Boolean } [destroy]
6130
6145
*/
6131
6146
6132
- function multiRemove ( ) {
6147
+ function multiRemove ( destroy ) {
6133
6148
var shouldCallRemove = _ . inDoc ( this . node )
6134
6149
var parent = this . node . parentNode
6135
6150
var node = this . node . nextSibling
@@ -6139,7 +6154,7 @@ return /******/ (function(modules) { // webpackBootstrap
6139
6154
while ( node !== this . end ) {
6140
6155
nodes . push ( node )
6141
6156
next = node . nextSibling
6142
- transition . remove ( node , vm )
6157
+ parent . removeChild ( node , vm )
6143
6158
node = next
6144
6159
}
6145
6160
parent . removeChild ( this . node )
@@ -6148,6 +6163,9 @@ return /******/ (function(modules) { // webpackBootstrap
6148
6163
if ( shouldCallRemove ) {
6149
6164
this . callHook ( detach )
6150
6165
}
6166
+ if ( destroy ) {
6167
+ this . destroy ( )
6168
+ }
6151
6169
}
6152
6170
6153
6171
/**
@@ -6406,25 +6424,20 @@ return /******/ (function(modules) { // webpackBootstrap
6406
6424
'false-value' : '_falseValue'
6407
6425
}
6408
6426
6427
+ // check for attribtues that prohibit interpolations
6428
+ var disallowedInterpAttrRE = / ^ v - | ^ : | ^ @ | ^ ( i s | t r a n s i t i o n | t r a n s i t i o n - m o d e | d e b o u n c e | t r a c k - b y | s t a g g e r | e n t e r - s t a g g e r | l e a v e - s t a g g e r ) $ /
6429
+
6409
6430
module . exports = {
6410
6431
6411
6432
priority : 850 ,
6412
6433
6413
6434
update : function ( value ) {
6414
6435
if ( this . arg ) {
6415
-
6416
6436
if ( true ) {
6417
- var attr = this . arg
6418
- if ( ! (
6419
- attr === 'class' ||
6420
- / ^ d a t a - / . test ( attr ) ||
6421
- ( attr === 'for' && 'htmlFor' in this . el ) ||
6422
- _ . camelize ( attr ) in this . el
6423
- ) ) {
6424
- _ . deprecation . ATTR_INVALID ( attr )
6437
+ if ( disallowedInterpAttrRE . test ( this . arg ) ) {
6438
+ _ . deprecation . ATTR_INVALID ( this . arg )
6425
6439
}
6426
6440
}
6427
-
6428
6441
this . setAttr ( this . arg , value )
6429
6442
} else if ( typeof value === 'object' ) {
6430
6443
// TODO no longer need to support object in 1.0.0
@@ -6580,15 +6593,15 @@ return /******/ (function(modules) { // webpackBootstrap
6580
6593
addClass ( this . el , value [ i ] )
6581
6594
}
6582
6595
}
6583
- this . prevKeys = value
6596
+ this . prevKeys = value . slice ( )
6584
6597
} ,
6585
6598
6586
6599
cleanup : function ( value ) {
6587
6600
if ( this . prevKeys ) {
6588
6601
var i = this . prevKeys . length
6589
6602
while ( i -- ) {
6590
6603
var key = this . prevKeys [ i ]
6591
- if ( ! value || ! contains ( value , key ) ) {
6604
+ if ( key && ( ! value || ! contains ( value , key ) ) ) {
6592
6605
removeClass ( this . el , key )
6593
6606
}
6594
6607
}
@@ -7363,6 +7376,12 @@ return /******/ (function(modules) { // webpackBootstrap
7363
7376
} ,
7364
7377
7365
7378
update : function ( handler ) {
7379
+ // stub a noop for v-on with no value,
7380
+ // e.g. @mousedown .prevent
7381
+ if ( ! this . _descriptor . raw ) {
7382
+ handler = function ( ) { }
7383
+ }
7384
+
7366
7385
if ( typeof handler !== 'function' ) {
7367
7386
( "development" ) !== 'production' && _ . warn (
7368
7387
'v-on:' + this . arg + '="' +
@@ -8835,7 +8854,13 @@ return /******/ (function(modules) { // webpackBootstrap
8835
8854
// support "item in items" syntax
8836
8855
var inMatch = this . expression . match ( / ( .* ) i n ( .* ) / )
8837
8856
if ( inMatch ) {
8838
- this . alias = inMatch [ 1 ]
8857
+ var itMatch = inMatch [ 1 ] . match ( / \( ( .* ) , ( .* ) \) / )
8858
+ if ( itMatch ) {
8859
+ this . iterator = itMatch [ 1 ] . trim ( )
8860
+ this . alias = itMatch [ 2 ] . trim ( )
8861
+ } else {
8862
+ this . alias = inMatch [ 1 ] . trim ( )
8863
+ }
8839
8864
this . _watcherExp = inMatch [ 2 ]
8840
8865
}
8841
8866
@@ -8922,6 +8947,7 @@ return /******/ (function(modules) { // webpackBootstrap
8922
8947
var oldFrags = this . frags
8923
8948
var frags = this . frags = new Array ( data . length )
8924
8949
var alias = this . alias
8950
+ var iterator = this . iterator
8925
8951
var start = this . start
8926
8952
var end = this . end
8927
8953
var inDoc = _ . inDoc ( start )
@@ -8945,6 +8971,9 @@ return /******/ (function(modules) { // webpackBootstrap
8945
8971
// update $key
8946
8972
if ( key ) {
8947
8973
frag . scope . $key = key
8974
+ if ( iterator ) {
8975
+ frag . scope [ iterator ] = key
8976
+ }
8948
8977
}
8949
8978
// update data for track-by, object repeat &
8950
8979
// primitive values.
@@ -8975,7 +9004,6 @@ return /******/ (function(modules) { // webpackBootstrap
8975
9004
frag = oldFrags [ i ]
8976
9005
if ( ! frag . reused ) {
8977
9006
this . deleteCachedFrag ( frag )
8978
- frag . destroy ( )
8979
9007
this . remove ( frag , removalIndex ++ , totalRemoved , inDoc )
8980
9008
}
8981
9009
}
@@ -9037,6 +9065,9 @@ return /******/ (function(modules) { // webpackBootstrap
9037
9065
// avoid accidental fallback
9038
9066
_ . define ( scope , '$key' , null )
9039
9067
}
9068
+ if ( this . iterator ) {
9069
+ _ . defineReactive ( scope , this . iterator , key || index )
9070
+ }
9040
9071
var frag = this . factory . create ( host , scope , this . _frag )
9041
9072
frag . forId = this . id
9042
9073
this . cacheFrag ( value , frag , index , key )
@@ -9142,11 +9173,11 @@ return /******/ (function(modules) { // webpackBootstrap
9142
9173
if ( inDoc && staggerAmount ) {
9143
9174
var op = frag . staggerCb = _ . cancellable ( function ( ) {
9144
9175
frag . staggerCb = null
9145
- frag . remove ( )
9176
+ frag . remove ( true )
9146
9177
} )
9147
9178
setTimeout ( op , staggerAmount )
9148
9179
} else {
9149
- frag . remove ( )
9180
+ frag . remove ( true )
9150
9181
}
9151
9182
} ,
9152
9183
@@ -9462,8 +9493,7 @@ return /******/ (function(modules) { // webpackBootstrap
9462
9493
9463
9494
insert : function ( ) {
9464
9495
if ( this . elseFrag ) {
9465
- this . elseFrag . remove ( )
9466
- this . elseFrag . destroy ( )
9496
+ this . elseFrag . remove ( true )
9467
9497
this . elseFrag = null
9468
9498
}
9469
9499
this . frag = this . factory . create ( this . _host , this . _scope , this . _frag )
@@ -9472,8 +9502,7 @@ return /******/ (function(modules) { // webpackBootstrap
9472
9502
9473
9503
remove : function ( ) {
9474
9504
if ( this . frag ) {
9475
- this . frag . remove ( )
9476
- this . frag . destroy ( )
9505
+ this . frag . remove ( true )
9477
9506
this . frag = null
9478
9507
}
9479
9508
if ( this . elseFactory ) {
@@ -10103,6 +10132,9 @@ return /******/ (function(modules) { // webpackBootstrap
10103
10132
// it will be filled up in _initScope().
10104
10133
this . _data = { }
10105
10134
10135
+ // call init hook
10136
+ this . _callHook ( 'init' )
10137
+
10106
10138
// initialize data observation and scope inheritance.
10107
10139
this . _initState ( )
10108
10140
@@ -11005,7 +11037,8 @@ return /******/ (function(modules) { // webpackBootstrap
11005
11037
11006
11038
// root is always compiled per-instance, because
11007
11039
// container attrs and props can be different every time.
11008
- var rootLinker = compiler . compileRoot ( el , options )
11040
+ var contextOptions = this . _context && this . _context . $options
11041
+ var rootLinker = compiler . compileRoot ( el , options , contextOptions )
11009
11042
11010
11043
// compile and link the rest
11011
11044
var contentLinkFn
@@ -11106,6 +11139,14 @@ return /******/ (function(modules) { // webpackBootstrap
11106
11139
var parent = this . $parent
11107
11140
if ( parent && ! parent . _isBeingDestroyed ) {
11108
11141
parent . $children . $remove ( this )
11142
+ // unregister ref
11143
+ var ref = this . $options . _ref
11144
+ if ( ref ) {
11145
+ var scope = this . _scope || this . _context
11146
+ if ( scope . $refs [ ref ] === this ) {
11147
+ scope . $refs [ ref ] = null
11148
+ }
11149
+ }
11109
11150
}
11110
11151
// remove self from owner fragment
11111
11152
if ( this . _frag ) {
@@ -11129,14 +11170,6 @@ return /******/ (function(modules) { // webpackBootstrap
11129
11170
while ( i -- ) {
11130
11171
this . _watchers [ i ] . teardown ( )
11131
11172
}
11132
- // unregister ref
11133
- var ref = this . $options . _ref
11134
- if ( ref ) {
11135
- var scope = this . _scope || this . _context
11136
- if ( scope . $ [ ref ] === this ) {
11137
- scope . $ [ ref ] = null
11138
- }
11139
- }
11140
11173
// remove reference to self on $el
11141
11174
if ( this . $el ) {
11142
11175
this . $el . __vue__ = null
@@ -11300,7 +11333,7 @@ return /******/ (function(modules) { // webpackBootstrap
11300
11333
if ( this . _literal ) {
11301
11334
this . update && this . update ( this . expression )
11302
11335
} else if (
11303
- this . _watcherExp &&
11336
+ ( this . _watcherExp || this . modifiers ) &&
11304
11337
( this . update || this . twoWay ) &&
11305
11338
( ! this . isLiteral || this . _isDynamicLiteral ) &&
11306
11339
! this . _checkStatement ( )
0 commit comments