前端定时器防抖节流
// 防抖(输入框可用) debounceFun (fun, time = 300){ clearTimeout(this.debounceTimer) this.debounceTimer = setTimeout(() => { fun() }, time) }, // 节流 throttleFun (fun, time = 300) { if (!this.isThrottleWork) { this.isThrottleWork = true fun() this.throttleTimer = setTimeout(() => { this.isThrottleWork = false clearTimeout(this.throttleTimer) }, time) } },