iview/src/components/select/utils.js

15 lines
337 B
JavaScript
Raw Normal View History

2017-09-03 08:49:45 +02:00
export function debounce(fn) {
let waiting;
return function() {
if (waiting) return;
waiting = true;
const context = this,
args = arguments;
const later = function() {
waiting = false;
fn.apply(context, args);
};
this.$nextTick(later);
};
}