|
1 | 1 | /*! |
2 | | - * mvvm.js v1.3.9 (c) 2017 TANG |
| 2 | + * mvvm.js v1.4.0 (c) 2017 TANG |
3 | 3 | * Released under the MIT license |
4 | | - * Sat Jan 14 2017 17:21:50 GMT+0800 (CST) |
| 4 | + * Sat Mar 18 2017 16:26:31 GMT+0800 (CST) |
5 | 5 | */ |
6 | 6 | (function (global, factory) { |
7 | 7 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : |
|
1630 | 1630 | vel.parse = function () { |
1631 | 1631 | // 不能在 vfor 中使用 |
1632 | 1632 | if (!this.scope) { |
1633 | | - var register = this.desc.expression; |
1634 | | - this.vm.$regEles[register] = this.el; |
| 1633 | + this.vm.$regEles[this.desc.expression] = this.el; |
1635 | 1634 | } else { |
1636 | 1635 | warn('v-el can not be used inside v-for! Consider use v-custom to handle v-for element.'); |
1637 | 1636 | } |
|
2864 | 2863 | } |
2865 | 2864 |
|
2866 | 2865 | /** |
2867 | | - * 保证 func 在 delay 时间内只触发一次 |
2868 | | - * @param {Function} func |
2869 | | - * @param {Number} delay |
2870 | | - * @return {TimeoutId} |
| 2866 | + * 保证 func 在上次执行后的 delay 时间内不会被触发第二次 |
| 2867 | + * @param {Function} func |
| 2868 | + * @param {Number} delay |
2871 | 2869 | */ |
2872 | | - var beginTime; |
| 2870 | + var beginTime = 0; |
2873 | 2871 | function debounceDelay (func, delay) { |
2874 | 2872 | beginTime = Date.now(); |
2875 | | - return setTimeout(function () { |
| 2873 | + setTimeout(function () { |
2876 | 2874 | if (Date.now() - beginTime >= delay) { |
2877 | 2875 | func.call(func); |
2878 | 2876 | } |
|
2948 | 2946 | /* istanbul ignore next */ |
2949 | 2947 | if (isMsie9) { |
2950 | 2948 | this.on('cut', function () { |
2951 | | - var this$1 = this; |
2952 | | - |
2953 | | - debounceDelay(function () { return setModelValue(this$1.value); }); |
| 2949 | + setModelValue(this.value); |
2954 | 2950 | }); |
2955 | 2951 |
|
2956 | 2952 | this.on('keyup', function (e) { |
|
0 commit comments