前端工作总结248-uni-预加载问题

<u-loadmore :status="status" />

    onReachBottom() {
                console.log('触底~~~~')
                 if (this.pageNo >= this.pages){
                    this.status = 'nomore';
                    return;
                }
                this.status = 'loading';
                this.pageNo = ++this.pageNo;
                setTimeout(() => {
                this.getData()
                    if (this.pageNo >= this.pages) {
                        this.status = 'nomore';
                    } else {
                        this.status = 'loading';
                    }
                }, 2000)
            }
            

 

posted @ 2022-09-16 22:44  前端导师歌谣  阅读(9)  评论(0)    收藏  举报