antd 组件 select 分页懒加载 onPopupScroll

<Select
value={this.state.value}
placeholder="请输入关键字"
showSearch
filterOption={false}
onPopupScroll={(e)=>{
const { target } = e;
// target.scrollTop + target.offsetHeight === target.scrollHeight 判断是否滑动到底部
if( target.scrollTop + target.offsetHeight === target.scrollHeight){
// 在这里调用接口
}
}}
>
{list.map(item) => <Option key={item.id}>{item.name}</Option>}
</Select>

posted @ 2021-09-24 15:17  泽泽生龙  阅读(1267)  评论(0编辑  收藏  举报