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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM