//节流函数 export function throttle(fn, gapTime = 1500) { let lastTime = 0; return function () { const nowTime = Date.now(); if (nowTime - lastTime >= gapTime) { lastTime = nowTime; fn.apply(this, arguments); } }; } module.exports = { throttle };