摘要: 1、防抖,触发高频事件后n秒内函数只会执行一次,如果n秒内高频事件再次出发,则重新计算时间。 const debounce = (fn, time) => { let timeout = null; return function() { clearTimeout(timeout) timeout 阅读全文
posted @ 2020-09-29 16:50 超哥20 阅读(121) 评论(0) 推荐(0) 编辑