onSearch = (value) => {
const { dispatch } = this.props;
dispatch({
type: 'reportVisual/getAnounceByStock',
payload: {
keyword: value,
size: 1000
}
})
};
handleonSearch = (value) => {
if (this.timer) {
clearTimeout(this.timer)
this.timer = 0
}
console.log(this.timer)
this.timer = setTimeout(() => {
this.timer = 0
this.onSearch(value)
}, 1000)
}
react中防抖处理
最新推荐文章于 2023-07-04 10:33:39 发布