// // 防抖
// const onChange = () => {
// if (id) clearTimeout(id)
// id = setTimeout(() => {
// console.log('请求后台');
// }, 500)
// }
// // 节流
// let isbool = false
// const onChange = () => {
// if (isbool) return false
// isbool = true
// setTimeout(() => {
// isbool = false
// }, 500)
// console.log('请求后台');
// }
原生节流防抖基础
最新推荐文章于 2023-12-28 17:54:41 发布