曹睿
2025-04-24 79210c2f29c65499e5ff8e4abc0c802b7b1c4065
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// [z-paging]使用页面滚动时引入此mixin,用于监听和处理onPullDownRefresh等页面生命周期方法
 
export default {
    onPullDownRefresh() {
        if (this.isPagingRefNotFound()) return;
        this.$refs.paging.reload().catch(() => {});
    },
    onPageScroll(e) {
        if (this.isPagingRefNotFound()) return;
        this.$refs.paging.updatePageScrollTop(e.scrollTop);
        e.scrollTop < 10 && this.$refs.paging.doChatRecordLoadMore();
    },
    onReachBottom() {
        if (this.isPagingRefNotFound()) return;
        this.$refs.paging.pageReachBottom();
    },
    methods: {
        isPagingRefNotFound() {
            return !this.$refs.paging;
        }
    }
}