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();
}
})
},
遇见问题,这是你成长的机会,如果你能够解决,这就是收获。
作者:晚来南风晚相识
出处:https://www.cnblogs.com/IwishIcould/
本文版权归作者所有,欢迎转载,未经作者同意须保留此段声明,在文章页面明显位置给出原文连接
如果文中有什么错误,欢迎指出。以免更多的人被误导。
出处:https://www.cnblogs.com/IwishIcould/
想问问题,打赏了卑微的博主,求求你备注一下的扣扣或者微信;这样我好联系你;(っ•̀ω•́)っ✎⁾⁾!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,或者关注博主,在此感谢!
万水千山总是情,打赏5毛买辣条行不行,所以如果你心情还比较高兴,也是可以扫码打赏博主(っ•̀ω•́)っ✎⁾⁾!
想问问题,打赏了卑微的博主,求求你备注一下的扣扣或者微信;这样我好联系你;(っ•̀ω•́)っ✎⁾⁾!
![](http://images.cnblogs.com/cnblogs_com/IwishIcould/1900124/t_201214043958支付宝收款码.jpg?a=1607924145179)
支付宝
![](http://images.cnblogs.com/cnblogs_com/IwishIcould/1900124/t_20121604194271E6E296CCB71A007F4E22073D5EB64A.jpg)
微信
如果文中有什么错误,欢迎指出。以免更多的人被误导。