yangan
2025-04-11 5e08d4f61c24db589bd6d30875fcb1191f719b16
utils/util.js
@@ -13,3 +13,22 @@
      return hour + ':' + minutes + ':' + seconds
   }
}
export const Debounce = (fn, wait) => {
    let delay = wait|| 500
    let timer
    return function () {
        let args = arguments;
        if (timer) {
            clearTimeout(timer)
        }
        let callNow = !timer
        timer = setTimeout(() => {
            timer = null
        }, delay)
        if (callNow) fn.apply(this, args)
    }
}