避免事件频繁触发的方法,用于界面防抖和函数节流等。
直接上代码。
onKeyDown = {(e) => {
e.persist();
let that = this;
setTimeout(() => {
that.function(e.target.value);
}, 200);
}}
避免事件频繁触发的方法,用于界面防抖和函数节流等。
直接上代码。
onKeyDown = {(e) => {
e.persist();
let that = this;
setTimeout(() => {
that.function(e.target.value);
}, 200);
}}