上拉加载出现错误,endPullupToRefresh is not a function

[ERROR] : TypeError: mui('#pullrefresh').pullRefresh().endPullupToRefresh is not a function. (In 'mui('#pullrefresh').pullRefresh().endPullupToRefresh(false)', 'mui('#pullrefresh').pullRefresh().endPullupToRefresh' is undefined)

哪位有遇到过同样的问题吗,我把示例代码放进来运行正常,自己写的只不过通过ajax加载数据而已



2018-03-13 17:49 添加评论 分享
已邀请:
0

追梦随想

赞同来自:

少了两个js文件
mui.pullToRefresh.js
mui.pullToRefresh.material.js
官方例子里有


0

一路格桑花

赞同来自:

那就不晓得了~


0

追梦随想

赞同来自:

/**
* 下拉刷新
*/
function pull_refresh_down(){
app.current_page = 1;
get_top_article(app.current_page, function(result){
if (result.item.total == 0) {
app.no_more = true;
} else {
//如果只有一页数据,则禁用上拉加载
if (result.item.total == 1) {
app.no_more = true;
mui('#pull_refresh').pullRefresh().disablePullupToRefresh();
}
app.total_pages = result.item.total;
app.article_list = result.item.list;
}
//结束下拉刷新
mui('#pull_refresh').pullRefresh().endPulldown();

//下拉刷新后重置上拉加载,恢复到可用状态
mui('#pull_refresh').pullRefresh().refresh(true);
app.no_more = false;
}, function(){
//请求失败
mui('#pull_refresh').pullRefresh().endPulldown();
});
}

/**
* 上拉加载
*/
function pull_refresh_up(){
var _this = this;
app.current_page ++;
//如果加载到最后一页,则禁用上拉加载
if (app.current_page >= app.total_pages) {
app.no_more = true;
_this.disablePullupToRefresh();
}
get_top_article(app.current_page, function(result){
if (result.item.list) {
for (var i in result.item.list) {
app.article_list.push(result.item.list[i]);
}
}
//结束上拉加载
_this.endPullupToRefresh(app.current_page >= app.total_pages);
});
}
\n

参考参考我的,完全没问题的


要回复问题请先登录注册