import React from 'react';
import { Table } from 'antd';
class TablePanel extends React.Component {
onScrollEvent=()=> {
if (this.scrollRef.scrollTop + this.scrollRef.clientHeight ===
this.scrollRef.scrollHeight) {
console.info('到底了!');
// todo 异步数据加载
}
}
render() {
return (
<div ref={c => this.scrollRef = c}
style={{ minHeight: 200, overflowY: 'scroll' }}
onScrollCapture={this.onScrollEvent}>
<Table ...params/>
</div>
);
}
}
export default TablePanel;