|
1 | 1 | /*! |
2 | | - * Vue.js v1.0.3 |
| 2 | + * Vue.js v1.0.4 |
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.3' |
| 149 | + Vue.version = '1.0.4' |
150 | 150 | module.exports = _.Vue = Vue |
151 | 151 |
|
152 | 152 | /* istanbul ignore if */ |
@@ -2409,6 +2409,9 @@ return /******/ (function(modules) { // webpackBootstrap |
2409 | 2409 | 'if' |
2410 | 2410 | ] |
2411 | 2411 |
|
| 2412 | + // default directive priority |
| 2413 | + var DEFAULT_PRIORITY = 1000 |
| 2414 | + |
2412 | 2415 | /** |
2413 | 2416 | * Compile a template and return a reusable composite link |
2414 | 2417 | * function, which recursively contains more link functions |
@@ -2491,8 +2494,8 @@ return /******/ (function(modules) { // webpackBootstrap |
2491 | 2494 | */ |
2492 | 2495 |
|
2493 | 2496 | function directiveComparator (a, b) { |
2494 | | - a = a.descriptor.def.priority || 0 |
2495 | | - b = b.descriptor.def.priority || 0 |
| 2497 | + a = a.descriptor.def.priority || DEFAULT_PRIORITY |
| 2498 | + b = b.descriptor.def.priority || DEFAULT_PRIORITY |
2496 | 2499 | return a > b ? -1 : a === b ? 0 : 1 |
2497 | 2500 | } |
2498 | 2501 |
|
@@ -2597,16 +2600,17 @@ return /******/ (function(modules) { // webpackBootstrap |
2597 | 2600 | } |
2598 | 2601 | } else if (("development") !== 'production' && containerAttrs) { |
2599 | 2602 | // warn container directives for fragment instances |
2600 | | - containerAttrs.forEach(function (attr) { |
2601 | | - if (attr.name.indexOf('v-') === 0 || attr.name === 'transition') { |
2602 | | - _.warn( |
2603 | | - attr.name + ' is ignored on component ' + |
2604 | | - '<' + options.el.tagName.toLowerCase() + '> because ' + |
2605 | | - 'the component is a fragment instance: ' + |
2606 | | - 'http://vuejs.org/guide/components.html#Fragment_Instance' |
2607 | | - ) |
2608 | | - } |
2609 | | - }) |
| 2603 | + var names = containerAttrs.map(function (attr) { |
| 2604 | + return '"' + attr.name + '"' |
| 2605 | + }).join(', ') |
| 2606 | + var plural = containerAttrs.length > 1 |
| 2607 | + _.warn( |
| 2608 | + 'Attribute' + (plural ? 's ' : ' ') + names + |
| 2609 | + (plural ? ' are' : ' is') + ' ignored on component ' + |
| 2610 | + '<' + options.el.tagName.toLowerCase() + '> because ' + |
| 2611 | + 'the component is a fragment instance: ' + |
| 2612 | + 'http://vuejs.org/guide/components.html#Fragment_Instance' |
| 2613 | + ) |
2610 | 2614 | } |
2611 | 2615 |
|
2612 | 2616 | return function rootLinkFn (vm, el, scope) { |
@@ -3696,8 +3700,8 @@ return /******/ (function(modules) { // webpackBootstrap |
3696 | 3700 | var parentScope = this._scope || this.vm |
3697 | 3701 | var scope = Object.create(parentScope) |
3698 | 3702 | // ref holder for the scope |
3699 | | - scope.$refs = {} |
3700 | | - scope.$els = {} |
| 3703 | + scope.$refs = Object.create(parentScope.$refs) |
| 3704 | + scope.$els = Object.create(parentScope.$els) |
3701 | 3705 | // make sure point $parent to parent scope |
3702 | 3706 | scope.$parent = parentScope |
3703 | 3707 | // for two-way binding on alias |
@@ -5058,6 +5062,10 @@ return /******/ (function(modules) { // webpackBootstrap |
5058 | 5062 | bind: function () { |
5059 | 5063 | var attr = this.arg |
5060 | 5064 | var tag = this.el.tagName |
| 5065 | + // should be deep watch on object mode |
| 5066 | + if (!attr) { |
| 5067 | + this.deep = true |
| 5068 | + } |
5061 | 5069 | // handle interpolation bindings |
5062 | 5070 | if (this.descriptor.interp) { |
5063 | 5071 | // only allow binding on native attributes |
@@ -5344,6 +5352,8 @@ return /******/ (function(modules) { // webpackBootstrap |
5344 | 5352 |
|
5345 | 5353 | module.exports = { |
5346 | 5354 |
|
| 5355 | + deep: true, |
| 5356 | + |
5347 | 5357 | update: function (value) { |
5348 | 5358 | if (value && typeof value === 'string') { |
5349 | 5359 | this.handleObject(stringToObject(value)) |
@@ -6154,19 +6164,18 @@ return /******/ (function(modules) { // webpackBootstrap |
6154 | 6164 | * getters, so that every nested property inside the object |
6155 | 6165 | * is collected as a "deep" dependency. |
6156 | 6166 | * |
6157 | | - * @param {Object} obj |
| 6167 | + * @param {*} val |
6158 | 6168 | */ |
6159 | 6169 |
|
6160 | | - function traverse (obj) { |
6161 | | - var key, val, i |
6162 | | - for (key in obj) { |
6163 | | - val = obj[key] |
6164 | | - if (_.isArray(val)) { |
6165 | | - i = val.length |
6166 | | - while (i--) traverse(val[i]) |
6167 | | - } else if (_.isObject(val)) { |
6168 | | - traverse(val) |
6169 | | - } |
| 6170 | + function traverse (val) { |
| 6171 | + var i, keys |
| 6172 | + if (_.isArray(val)) { |
| 6173 | + i = val.length |
| 6174 | + while (i--) traverse(val[i]) |
| 6175 | + } else if (_.isObject(val)) { |
| 6176 | + keys = Object.keys(val) |
| 6177 | + i = keys.length |
| 6178 | + while (i--) traverse(val[keys[i]]) |
6170 | 6179 | } |
6171 | 6180 | } |
6172 | 6181 |
|
@@ -7112,7 +7121,7 @@ return /******/ (function(modules) { // webpackBootstrap |
7112 | 7121 |
|
7113 | 7122 | p.enterNextTick = function () { |
7114 | 7123 |
|
7115 | | - // Importnatn hack: |
| 7124 | + // Important hack: |
7116 | 7125 | // in Chrome, if a just-entered element is applied the |
7117 | 7126 | // leave class while its interpolated property still has |
7118 | 7127 | // a very small value (within one frame), Chrome will |
@@ -9457,15 +9466,15 @@ return /******/ (function(modules) { // webpackBootstrap |
9457 | 9466 | while (i--) { |
9458 | 9467 | key = params[i] |
9459 | 9468 | mappedKey = _.camelize(key) |
9460 | | - val = _.attr(this.el, key) |
| 9469 | + val = _.getBindAttr(this.el, key) |
9461 | 9470 | if (val != null) { |
9462 | | - // static |
9463 | | - this.params[mappedKey] = val === '' ? true : val |
9464 | | - } else { |
9465 | 9471 | // dynamic |
9466 | | - val = _.getBindAttr(this.el, key) |
| 9472 | + this._setupParamWatcher(mappedKey, val) |
| 9473 | + } else { |
| 9474 | + // static |
| 9475 | + val = _.attr(this.el, key) |
9467 | 9476 | if (val != null) { |
9468 | | - this._setupParamWatcher(mappedKey, val) |
| 9477 | + this.params[mappedKey] = val === '' ? true : val |
9469 | 9478 | } |
9470 | 9479 | } |
9471 | 9480 | } |
@@ -9522,7 +9531,7 @@ return /******/ (function(modules) { // webpackBootstrap |
9522 | 9531 | fn.call(scope, scope) |
9523 | 9532 | } |
9524 | 9533 | if (this.filters) { |
9525 | | - handler = this.vm._applyFilters(handler, null, this.filters) |
| 9534 | + handler = scope._applyFilters(handler, null, this.filters) |
9526 | 9535 | } |
9527 | 9536 | this.update(handler) |
9528 | 9537 | return true |
|
0 commit comments