Skip to content

Commit

Permalink
Released on 20170318.
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbc committed Mar 18, 2017
1 parent 9c11b57 commit 2be2ff8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
22 changes: 9 additions & 13 deletions dist/mvvm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* mvvm.js v1.3.9 (c) 2017 TANG
* mvvm.js v1.4.0 (c) 2017 TANG
* Released under the MIT license
* Sat Jan 14 2017 17:21:50 GMT+0800 (CST)
* Sat Mar 18 2017 16:26:31 GMT+0800 (CST)
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -1630,8 +1630,7 @@
vel.parse = function () {
// 不能在 vfor 中使用
if (!this.scope) {
var register = this.desc.expression;
this.vm.$regEles[register] = this.el;
this.vm.$regEles[this.desc.expression] = this.el;
} else {
warn('v-el can not be used inside v-for! Consider use v-custom to handle v-for element.');
}
Expand Down Expand Up @@ -2864,15 +2863,14 @@
}

/**
* 保证 func 在 delay 时间内只触发一次
* @param {Function} func
* @param {Number} delay
* @return {TimeoutId}
* 保证 func 在上次执行后的 delay 时间内不会被触发第二次
* @param {Function} func
* @param {Number} delay
*/
var beginTime;
var beginTime = 0;
function debounceDelay (func, delay) {
beginTime = Date.now();
return setTimeout(function () {
setTimeout(function () {
if (Date.now() - beginTime >= delay) {
func.call(func);
}
Expand Down Expand Up @@ -2948,9 +2946,7 @@
/* istanbul ignore next */
if (isMsie9) {
this.on('cut', function () {
var this$1 = this;

debounceDelay(function () { return setModelValue(this$1.value); });
setModelValue(this.value);
});

this.on('keyup', function (e) {
Expand Down
Loading

0 comments on commit 2be2ff8

Please sign in to comment.