lottery-flip-card/util/common.js

17 lines
299 B
JavaScript
Raw Normal View History

2024-05-30 11:01:36 +08:00
export const Debounce = (func, delay) => {
let timer;
return function() {
const context = this;
const args = arguments;
clearTimeout(timer);
uni.showLoading({
title: '加载中...'
})
timer = setTimeout(() => {
func.apply(context, args);
uni.hideLoading()
}, delay);
};
}