给select下拉框添加属性
dropdownRender={menu => (
<div>
{menu}
<div
className="selectScroll"
style={{ textAlign: 'center' }}
onMouseDown={e => e.preventDefault()}
>
{
selectLoading && // 加载状态
<Spin size="small" style={{ padding: '8px' }} />
}
</div>
</div>
)}
onPopupScroll={this.companyScroll }
companyScroll = (e) => {
const { clientHeight, scrollHeight, scrollTop } = e.target;
const { pageTotal, selectLoading } = this.state;
if ((clientHeight + scrollTop === scrollHeight) && !selectLoading) {
this.setState({
selectCurPage: this.state.selectCurPage + 1,
}, () => {
if (Math.ceil(pageTotal / 15) >= this.state.selectCurPage) {
// 获取数据的接口
}
});
}
}