接入语音

This commit is contained in:
aixianling
2023-11-10 17:13:55 +08:00
parent ad77470063
commit 24a775f94a
5 changed files with 55 additions and 22 deletions

View File

@@ -43,3 +43,9 @@ export const addJs = url => {
script.src = url
document.body.appendChild(script)
}
export const throttle = (fn, delay = 1000) => {
if (typeof fn != "function") return;
if (window.throttleTimer) clearTimeout(window.throttleTimer)
window.throttleTimer = setTimeout(() => fn.call(), delay)
}