//防抖,重复提交
debounceFn(fn, t) {
let delay = t || 1000
// let timer
return () => {
let args = arguments;
if (this.timer) {
clearTimeout(this.timer)
}
let callNow = !this.timer
this.timer = setTimeout(() => {
this.timer = null
}, delay)
if (callNow) { fn.apply(this, args); }
}
},