看了一下pullRefresh的源码,发现好像没有调用scroll()的方法
pullRefresh的几个init
mui.init pulldownRefresh
init: function(element, options) {
this._super(element, $.extend(true, {
scrollY: true,
scrollX: false,
indicators: true,
deceleration: 0.003,
down: {
height: 50,
contentinit: '下拉可以刷新',
contentdown: '下拉可以刷新',
contentover: '释放立即刷新',
contentrefresh: '正在刷新...'
},
up: {
height: 50,
auto: false,
contentinit: '上拉显示更多',
contentdown: '上拉显示更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了',
duration: 300
}
}, options));
},
_init: function() {
this._super();
this._initPocket();
},
pullRefresh 5+
init: function(element, options) {
this.element = element;
this.options = options;
this.wrapper = this.scroller = element;
this._init();
this._initPulldownRefreshEvent();
},
_init: function() {
var self = this;
//document.addEventListener('plusscrollbottom', this);
window.addEventListener('dragup', self);
document.addEventListener("plusscrollbottom", self);
self.scrollInterval = window.setInterval(function() {
if (self.isScroll && !self.loading) {
if (window.pageYOffset + window.innerHeight + 10 >= document.documentElement.scrollHeight) {
self.isScroll = false; //放在这里是因为快速滚动的话,有可能检测时,还没到底,所以只要有滚动,没到底之前一直检测高度变化
if (self.bottomPocket) {
self.pullupLoading();
}
}
}
}, 100);
},
想给pullRefresh添加一个和scroll().destroy()方法,应该怎么加?
2 个回复
AlertZMK (作者)
打开了二层的proto
找到了scroll()相关的api,所以pullRefresh()继承自scroll()方法,我尝试调用这个destroy()方法,报错
请问大佬们,我应该怎么调用destroy()才能做到把pullRefresh()生成的scroll去掉呢?
DCloud_UNI_FXY
在mui.class.scroll.pullrefresh.js中增加destroy方法