使用 Vue 的 Vant List列表组件实现无限下拉
<template>
<div>
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
<div v-for="(item, index) in list" :key="index" class="waitingList"></div>
</van-list>
</div>
</template>
<script>
export default {
name: 'WaitingList',
data() {
return {
loading: false,
finished: false,
pageNo: 1,
pageLimit: 10,
totalCount: 0,
list: [],
isLoading: false
}
},
created() {
console.log(this.datas)
this.getList()
this.currentUser = window.localStorage.userId
console.log(window.localStorage.userId)
},
methods: {
onLoad() {
// debugger
this.pageNo++
this.getList()
},
getList() {
let form = {
timeStatus: this.currentIndex,
billCode: this.billCode,
status: this.datas,
pageNo: this.pageNo,
pageLimit: this.pageLimit
}
this.$api.inspection.inspectionList(form).then(res => {
if (res.code === '0') {
let list = res.data.list
this.totalCount = res.data.paginator.totalCount
this.loading = false //是否处于加载状态,加载过程中不触发load事件
if (list == null || list.length === 0) {
this.finished = true // 加载结束
return
}
this.$nextTick(() => {
this.list = this.list.concat(list)
})
}
})
},
onRefresh() {
this.list = []
this.pageNo = 1
this.getList()
this.$toast('刷新成功')
this.isLoading = false
}
}
}
</script>
14 条评论
2025年10月新盘 做第一批吃螃蟹的人coinsrore.com
新车新盘 嘎嘎稳 嘎嘎靠谱coinsrore.com
新车首发,新的一年,只带想赚米的人coinsrore.com
新盘 上车集合 留下 我要发发 立马进裙coinsrore.com
做了几十年的项目 我总结了最好的一个盘(纯干货)coinsrore.com
新车上路,只带前10个人coinsrore.com
新盘首开 新盘首开 征召客户!!!coinsrore.com
新项目准备上线,寻找志同道合 的合作伙伴coinsrore.com
新车即将上线 真正的项目,期待你的参与coinsrore.com
新盘新项目,不再等待,现在就是最佳上车机会!coinsrore.com
新盘新盘 这个月刚上新盘 新车第一个吃螃蟹!coinsrore.com
新盘 上车集合 留下 我要发发 立马进裙
风水二十年
蝙蝠侠龙之魂
暴裂无声
音乐是怎么变成免费午餐的
银魂剧场新译红樱篇
林场追杀
红灯停绿灯行
骗骗喜欢你
穷凶极恶
噢加拿大
猴形扣手
你的文章让我感受到了艺术的魅力,谢谢! https://www.4006400989.com/qyvideo/75039.html