定义timeout初值为null
debounce(cb, wait = 500) { if (this.timeout !== null) { clearTimeout(this.timeout); } this.timeout = setTimeout(() => { this.timeout = null; cb && cb(); }, wait); },