Files
medicine_app/uni_modules/z-paging/components/z-paging/z-paging-mixin.js
2024-05-22 13:42:15 +08:00

36 lines
766 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// z-paging
// github地址:https://github.com/SmileZXLee/uni-z-paging
// dcloud地址:https://ext.dcloud.net.cn/plugin?id=3935
// 反馈QQ群790460711
// 使用页面滚动时引入此mixin用于监听和处理onPullDownRefresh等页面生命周期方法
const ZPagingMixin = {
onPullDownRefresh(){
if(this.isPagingRefNotFound()){
return;
}
this.$refs.paging.reload();
},
onPageScroll(e) {
if(this.isPagingRefNotFound()){
return;
}
this.$refs.paging.updatePageScrollTop(e.scrollTop);
},
onReachBottom() {
if(this.isPagingRefNotFound()){
return;
}
this.$refs.paging.doLoadMore();
},
methods: {
isPagingRefNotFound(){
return !this.$refs.paging || this.$refs.paging === undefined;
}
}
}
export default ZPagingMixin;