vue中输入框改变防抖传参的使用
<el-input v-else @input="(val) => {changeEffectDebounce(val, scope.row);}" placeholder="请输入" ></el-input>
methods: {
changeEffectDebounce: debounce(
function (val, obj) {
}
) debounce (fn, delay) {
let timer
return function () {
let args = arguments
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
timer = null
fn.apply(this, args)
}, delay)
}
}
}