<Select
showSearch // 支持搜索
allowClear // 支持清除所选项
onPopupScroll={onPopupScroll}
listHeight={300} // select下拉栏展示高度
optionFilterProp="label" // 搜索label值展示
options={
arr.map((item, index) => {
return {
value: item.value,
label: item.label
}
})
}/>
onPopupScroll 如下:
const onPackagePopupScroll = async (e) => {
const {target} = e;
// 判断是否滑动到底部 滚动条顶部距离 + 下拉栏展示高度 = 滚动总高度
if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
// 滑动到底部实现分页加载逻辑
}
}