|
1 | 1 | /*! |
2 | | - * Vue.js v2.2.0-beta.2 |
| 2 | + * Vue.js v2.2.0 |
3 | 3 | * (c) 2014-2017 Evan You |
4 | 4 | * Released under the MIT License. |
5 | 5 | */ |
@@ -389,6 +389,10 @@ function isNative (Ctor) { |
389 | 389 | return /native code/.test(Ctor.toString()) |
390 | 390 | } |
391 | 391 |
|
| 392 | +var hasSymbol = |
| 393 | + typeof Symbol !== 'undefined' && isNative(Symbol) && |
| 394 | + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); |
| 395 | + |
392 | 396 | /** |
393 | 397 | * Defer a task to execute it asynchronously. |
394 | 398 | */ |
@@ -1450,60 +1454,6 @@ function handleError (err, vm, type) { |
1450 | 1454 | } |
1451 | 1455 | } |
1452 | 1456 |
|
1453 | | - |
1454 | | - |
1455 | | -var util = Object.freeze({ |
1456 | | - defineReactive: defineReactive$$1, |
1457 | | - _toString: _toString, |
1458 | | - toNumber: toNumber, |
1459 | | - makeMap: makeMap, |
1460 | | - isBuiltInTag: isBuiltInTag, |
1461 | | - remove: remove, |
1462 | | - hasOwn: hasOwn, |
1463 | | - isPrimitive: isPrimitive, |
1464 | | - cached: cached, |
1465 | | - camelize: camelize, |
1466 | | - capitalize: capitalize, |
1467 | | - hyphenate: hyphenate, |
1468 | | - bind: bind, |
1469 | | - toArray: toArray, |
1470 | | - extend: extend, |
1471 | | - isObject: isObject, |
1472 | | - isPlainObject: isPlainObject, |
1473 | | - toObject: toObject, |
1474 | | - noop: noop, |
1475 | | - no: no, |
1476 | | - identity: identity, |
1477 | | - genStaticKeys: genStaticKeys, |
1478 | | - looseEqual: looseEqual, |
1479 | | - looseIndexOf: looseIndexOf, |
1480 | | - once: once, |
1481 | | - emptyObject: emptyObject, |
1482 | | - isReserved: isReserved, |
1483 | | - def: def, |
1484 | | - parsePath: parsePath, |
1485 | | - hasProto: hasProto, |
1486 | | - inBrowser: inBrowser, |
1487 | | - UA: UA, |
1488 | | - isIE: isIE, |
1489 | | - isIE9: isIE9, |
1490 | | - isEdge: isEdge, |
1491 | | - isAndroid: isAndroid, |
1492 | | - isIOS: isIOS, |
1493 | | - isChrome: isChrome, |
1494 | | - isServerRendering: isServerRendering, |
1495 | | - devtools: devtools, |
1496 | | - nextTick: nextTick, |
1497 | | - get _Set () { return _Set; }, |
1498 | | - mergeOptions: mergeOptions, |
1499 | | - resolveAsset: resolveAsset, |
1500 | | - get warn () { return warn; }, |
1501 | | - get tip () { return tip; }, |
1502 | | - get formatComponentName () { return formatComponentName; }, |
1503 | | - validateProp: validateProp, |
1504 | | - handleError: handleError |
1505 | | -}); |
1506 | | - |
1507 | 1457 | /* not type checking this file because flow doesn't play well with Proxy */ |
1508 | 1458 |
|
1509 | 1459 | var initProxy; |
@@ -3629,7 +3579,12 @@ function initInjections (vm) { |
3629 | 3579 | // inject is :any because flow is not smart enough to figure out cached |
3630 | 3580 | // isArray here |
3631 | 3581 | var isArray = Array.isArray(inject); |
3632 | | - var keys = isArray ? inject : Object.keys(inject); |
| 3582 | + var keys = isArray |
| 3583 | + ? inject |
| 3584 | + : hasSymbol |
| 3585 | + ? Reflect.ownKeys(inject) |
| 3586 | + : Object.keys(inject); |
| 3587 | + |
3633 | 3588 | for (var i = 0; i < keys.length; i++) { |
3634 | 3589 | var key = keys[i]; |
3635 | 3590 | var provideKey = isArray ? key : inject[key]; |
@@ -4068,7 +4023,17 @@ function initGlobalAPI (Vue) { |
4068 | 4023 | }; |
4069 | 4024 | } |
4070 | 4025 | Object.defineProperty(Vue, 'config', configDef); |
4071 | | - Vue.util = util; |
| 4026 | + |
| 4027 | + // exposed util methods. |
| 4028 | + // NOTE: these are not considered part of the public API - avoid relying on |
| 4029 | + // them unless you are aware of the risk. |
| 4030 | + Vue.util = { |
| 4031 | + warn: warn, |
| 4032 | + extend: extend, |
| 4033 | + mergeOptions: mergeOptions, |
| 4034 | + defineReactive: defineReactive$$1 |
| 4035 | + }; |
| 4036 | + |
4072 | 4037 | Vue.set = set; |
4073 | 4038 | Vue.delete = del; |
4074 | 4039 | Vue.nextTick = nextTick; |
@@ -4096,7 +4061,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', { |
4096 | 4061 | get: isServerRendering |
4097 | 4062 | }); |
4098 | 4063 |
|
4099 | | -Vue$3.version = '2.2.0-beta.2'; |
| 4064 | +Vue$3.version = '2.2.0'; |
4100 | 4065 |
|
4101 | 4066 | /* */ |
4102 | 4067 |
|
@@ -6358,16 +6323,35 @@ function enter (vnode, toggleDisplay) { |
6358 | 6323 | return |
6359 | 6324 | } |
6360 | 6325 |
|
6361 | | - var startClass = isAppear && appearClass ? appearClass : enterClass; |
6362 | | - var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass; |
6363 | | - var toClass = isAppear && appearToClass ? appearToClass : enterToClass; |
6364 | | - |
6365 | | - var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter; |
6366 | | - var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter; |
6367 | | - var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter; |
6368 | | - var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled; |
| 6326 | + var startClass = isAppear && appearClass |
| 6327 | + ? appearClass |
| 6328 | + : enterClass; |
| 6329 | + var activeClass = isAppear && appearActiveClass |
| 6330 | + ? appearActiveClass |
| 6331 | + : enterActiveClass; |
| 6332 | + var toClass = isAppear && appearToClass |
| 6333 | + ? appearToClass |
| 6334 | + : enterToClass; |
| 6335 | + |
| 6336 | + var beforeEnterHook = isAppear |
| 6337 | + ? (beforeAppear || beforeEnter) |
| 6338 | + : beforeEnter; |
| 6339 | + var enterHook = isAppear |
| 6340 | + ? (typeof appear === 'function' ? appear : enter) |
| 6341 | + : enter; |
| 6342 | + var afterEnterHook = isAppear |
| 6343 | + ? (afterAppear || afterEnter) |
| 6344 | + : afterEnter; |
| 6345 | + var enterCancelledHook = isAppear |
| 6346 | + ? (appearCancelled || enterCancelled) |
| 6347 | + : enterCancelled; |
| 6348 | + |
| 6349 | + var explicitEnterDuration = toNumber( |
| 6350 | + isObject(duration) |
| 6351 | + ? duration.enter |
| 6352 | + : duration |
| 6353 | + ); |
6369 | 6354 |
|
6370 | | - var explicitEnterDuration = isObject(duration) ? duration.enter : duration; |
6371 | 6355 | if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) { |
6372 | 6356 | checkDuration(explicitEnterDuration, 'enter', vnode); |
6373 | 6357 | } |
@@ -6467,7 +6451,12 @@ function leave (vnode, rm) { |
6467 | 6451 | var expectsCSS = css !== false && !isIE9; |
6468 | 6452 | var userWantsControl = getHookAgumentsLength(leave); |
6469 | 6453 |
|
6470 | | - var explicitLeaveDuration = isObject(duration) ? duration.leave : duration; |
| 6454 | + var explicitLeaveDuration = toNumber( |
| 6455 | + isObject(duration) |
| 6456 | + ? duration.leave |
| 6457 | + : duration |
| 6458 | + ); |
| 6459 | + |
6471 | 6460 | if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) { |
6472 | 6461 | checkDuration(explicitLeaveDuration, 'leave', vnode); |
6473 | 6462 | } |
@@ -6818,7 +6807,7 @@ var transitionProps = { |
6818 | 6807 | appearClass: String, |
6819 | 6808 | appearActiveClass: String, |
6820 | 6809 | appearToClass: String, |
6821 | | - duration: [Number, Object] |
| 6810 | + duration: [Number, String, Object] |
6822 | 6811 | }; |
6823 | 6812 |
|
6824 | 6813 | // in case the child is also an abstract component, e.g. <keep-alive> |
|
0 commit comments