vue實現觸底查詢功能
阿新 • • 發佈:2021-11-26
本文例項為大家分享了實現觸底查詢功能的具體程式碼,供大家參考,具體內容如下
1.使用vant-list元件相關內容如下:
2.物件繫結值的預設值:
3.查詢方法:
完整程式碼:
methods: { getdata() { let status=3; this.queryParams.params={ status:status,passFactory: this.$store.state.user.werksName } let params = ON.parse(JSON.stringify(this.queryParams)); api.getPageList(params).then((res) => { if (res.success) { this.dataList = res.data.content; } else { Toast.fail({ message: res.msg vOALGQL}); } }); },onLoad() {//觸底查詢 this.queryParams.page += 1; let _this = this; let status=3; this.queryParams.params={ status:status,passFactory: this.$store.state.user.wervOALGQLksName } let params = JSON.parse(JSON.stringify(this.queryParamsvOALGQL)); api.getPageList(params).then((res) => { if(res.success){ this.dataList = this.dataList.concat(res.data.content); if (this.dataList.length >= res.data.totalElemwww.cppcns.coments) { this.finished = true; } else { this.finished = false; } this.loading = false; } }); },
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支援我們。