Vant中List列表下拉加载更多

van-list上只有一层父级元素div,多了可能下拉加载出不来;或者更多

<template>
    <div class="scholl-declarepage">
	
        <van-list
            v-model="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
            :immediate-check="cheack"
            >
			
                <swipe-cell
                custom
                class="bootom-having-border"
                :isEdit="isEdit"
                v-for="(item,index) in listAchool" :key="index"
                @edit="detior(item)"
                @remove="delItem(item)"
                >
                    <scholl-list-com :listObj="item" @gotodetails="gotodetails(item)"></scholl-list-com>
                </swipe-cell>
            </van-list>  
    </div>
</template>

loading: false,
finished: false,
 cheack:true,

paramsList:{
	orgId: "",
	pageIndex: 0,
	pageSize: 10 
},
listAchool:[],


 onLoad(){
	this.paramsList.pageIndex+=1;
	 this.schoolListContApi();//列表渲染
},
			
   schoolListContApi(){
                this.paramsList.orgId=this.userInfo.orgId,
                schoolListCont(this.paramsList).then(res=>{
                    console.log(res);
                    if(res.success==true){
						
                        this.loading = false;// 这一次的加载状态结束 
                        this.listAchool=this.listAchool.concat(res.data); 
                       
                       if(res.data.length==0 || this.listAchool.length>=res.totalDatas){
                            this.finished = true;//所有的数据已经全部加载完了
                        }else{
                            this.finished = false;
                        }
                    }else{
                        this.finished = false;
                    }
                
                })
            },	
				
				
				
 // 删除请求
commendDelApi(item){
	let params={
		id:item.id
	}
	schoolDelCont(params).then(res=>{
		if(res.success==true){
			this.paramsList.pageIndex=1;//重新赋值
			this.listAchool=[];
			this.schoolListContApi();
		}   
	})
},
posted @   南风晚来晚相识  阅读(1618)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
点击右上角即可分享
微信分享提示