1.引入uni-app中uni-load-more.vue  ,可按alt键点击引入的vue 查看使用的上拉刷新的代码

import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';

2.data 中定义 loadingType

            // more = contentdown: "上拉显示更多",
            // loading =contentrefresh: "正在加载...",
            // nomore = contentnomore: "没有更多数据了"

data(){
    return{
        loadingType: 'more' //加载更多状态
    }
}

3.页面底部加入上拉刷新时的标签

<uni-load-more :status="loadingType"></uni-load-more>

4.上拉刷新监听事件

onReachBottom() {
			console.log("上滑动");
	// more = contentdown: "上拉显示更多",
	// loading =contentrefresh: "正在加载...",
	// nomore = contentnomore: "没有更多数据了"
    // 在此进行上拉刷新的业务逻辑

}

 

 

Logo

前往低代码交流专区

更多推荐