isfilter(val) { // 过滤 this.debounce(() => { this.init(val); }, 1000); }, debounce(fn, delay) { var delay = delay || 200; var timer; console.log('33333333'); return (function () { var th = this; var args = arguments; if (timer) { clearTimeout(timer); } timer = setTimeout(() => { timer = null; fn.apply(th, args); console.log('111111111111'); }, delay); })(); },
标签:vue,console,节流,中防抖,timer,delay,var,log From: https://www.cnblogs.com/wsj1/p/16917878.html