iview/src/components/select/utils.js
2019-08-27 09:42:40 +08:00

14 lines
337 B
JavaScript

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);
};
}