此方法在 mui.plusReady 里面怎么调用? this.endPullupToRefresh 报错:has no method 'endPullupToRefresh' 页面初始化时候,不想显示 上拉显示更多, 怎么办?
参考hello-mui里的pullup.html里边的代码。 具体方案: 1.初始化上拉加载 2.手动调用一次pullupLoading(),该方法会自动显示正在加载中,并执行你的上拉加载回调函数; 3.在你的上拉加载的回调里边请求服务端,根据返回判断是否还有更多数据,如果没有了。就endPullupToRefresh(true)停止上拉加载功能。
mui.plusReady(function() { //从服务器获取数据 //this.pullupLoading(); }); 会报错:Uncaught TypeError: Object [object DOMWindow] has no method 'pullLoading' at
{{{ //pullup-container为在mui.init方法中配置的pullRefresh节点中的container参数; mui('#pullup-container').pullRefresh().refresh(true); }}}
<script src="../js/mui.min.js"></script> <script src="../js/mui.pullToRefresh.js"></script> <script src="../js/mui.pullToRefresh.material.js"></script> 将这三个文件都 引入,将方法名字改为endPullUpToRefresh,就是将up改为Up
7 个回复
DCloud_UNI_FXY
你是想在什么时候显示“上拉显示更多”?
蓝莲花 (作者)
打开界面时候,初始化我会从服务器下载数据,如果数据多于10行,我就显示,不然我就不显示;
DCloud_UNI_FXY
参考hello-mui里的pullup.html里边的代码。
具体方案:
1.初始化上拉加载
2.手动调用一次pullupLoading(),该方法会自动显示正在加载中,并执行你的上拉加载回调函数;
3.在你的上拉加载的回调里边请求服务端,根据返回判断是否还有更多数据,如果没有了。就endPullupToRefresh(true)停止上拉加载功能。
蓝莲花 (作者)
谢谢指教
蓝莲花 (作者)
mui.plusReady(function() {
//从服务器获取数据
//this.pullupLoading();
});
会报错:Uncaught TypeError: Object [object DOMWindow] has no method 'pullLoading' at
DCloud_UNI_FXY
{{{
//pullup-container为在mui.init方法中配置的pullRefresh节点中的container参数;
mui('#pullup-container').pullRefresh().refresh(true);
}}}
s***@163.com - 90后it男
<script src="../js/mui.min.js"></script>
<script src="../js/mui.pullToRefresh.js"></script>
<script src="../js/mui.pullToRefresh.material.js"></script>
将这三个文件都 引入,将方法名字改为endPullUpToRefresh,就是将up改为Up
a萌新程序媛
第二个第三个的插件的方法是怎么使用的呢
2018-11-07 16:23
s***@163.com
回复 a萌新程序媛:
<!--下拉刷新容器-->
<div id="pullDiv0" class="mui-content mui-scroll-wrapper"style="margin-top: 74px;" >
<div class="mui-scroll">
<!--数据列表-->
<ul class="mui-table-view mui-table-view-chevron"></ul>
</div>
</div>
<!--下拉刷新容器-->
<div id="pullDiv1" class="mui-content mui-scroll-wrapper"style="margin-top: 74px;display: none;" >
<div class="mui-scroll">
<!--数据列表-->
<ul class="mui-table-view mui-table-view-chevron"></ul>
</div>
</div>
<!--下拉刷新容器-->
<div id="pullDiv2" class="mui-content mui-scroll-wrapper"style="margin-top: 74px;display: none;" >
<div class="mui-scroll">
<!--数据列表-->
<ul class="mui-table-view mui-table-view-chevron"></ul>
</div>
</div>
mui("#pullPlace .mui-scroll").each(function(index,element){
if(index == 0){//第一次自动刷新
mui(element).pullToRefresh({
down: {
callback: function() {
var self = this;
setTimeout(function() {
pulldownRefreshf(self,index);
_self.endPullDownToRefresh();
}, 1000);
}
},
up: {
auto:true,
callback: function() {
var self = this;
setTimeout(function() {
pullupRefreshf(self,index);
_self.endPullUpToRefresh(“boolean值”);
}, 1000);
}
}
})
}else{//第一次之后,点击刷新
mui(element).pullToRefresh({
down: {
callback: function() {
var self = this;
setTimeout(function() {
pulldownRefreshf(self,index);
_self.endPullDownToRefresh();
}, 1000);
}
},
up: {
callback: function() {
var self = this;
setTimeout(function() {
pullupRefreshf(self,index);
_self.endPullUpToRefresh(“boolean值”);
}, 1000);
}
}
})
}
})
2018-11-14 13:56