<!--数据列表-->
<div id="pullrefresh">
<ul class="mui-table-view" id="StationList" style="margin-top:50px; height: auto;">
<li></li>
</ul>
</div>
mui('#pullrefresh').pullRefresh().refresh(true)//启用上拉加载
mui('#pullrefresh').pullRefresh().enablePullupToRefresh();//启用上拉加载
var Flag = true; //表示 是否还有数据
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
callback: pulldownRefresh
},
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
//下拉
function pulldownRefresh() {
setTimeout(function() {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
}, 1000);
}
//上拉加载具体业务实现
function pullupRefresh() {
setTimeout(function() {
console.log("上拉")
mui('#pullrefresh').pullRefresh().endPullupToRefresh(Flag); //参数为true代表没有更多数据了。
}, 1000);
}