```javascript
import React from 'react'
import { ListView } from 'antd-mobile';
class ListContainer extends React.Component {
constructor(props) {
super(props);
const dataSource = new ListView.DataSource({
rowHasChanged: (row1, row2) => row1 !== row2,
});
this.state = {
dataSource,
isLoading: true,
hasMore: true
};
}
componentWillReceiveProps(nextProps) {
this.setState({
dataSource: this.state.dataSource.cloneWithRows(nextProps.dataList),
refreshing: false,
isLoading: false,
});
}
onEndReached = () => {
if(this.props.dataList.length < 9) {
this.setState({
hasMore: false
})
}else {
this.props.getData()
}
};
render() {
return (
<div>
<ListView
ref={el => this.lv = el}
dataSource={this.state.dataSource}
renderFooter={
() => (
<div style={{ textAlign: 'center' }}>
{this.state.isLoading ? '加载中...' : '暂无数据'}
</div>
)
}
renderRow={this.props.row}
style={{
minHeight: 'calc(100vh - 100px)',
border: '1px solid #ddd',
margin: '5px 0',
}}
onEndReached={this.onEndReached}
pageSize={10}
/>
</div>
);
}
}
export default ListContainer
## 用法
```javascript
import ListContainer from '../../components/ListView'
// 应用
<List>
{this.state.data && <ListContainer dataList={this.state.data} row={row} getData={this.getData} /> }
</List>