使用vantui的van-list,上拉只能加载一次问题总结

it2026-04-07  3

van-list @load方法只生效一次

经给仔细的检查和阅读官方给的介绍,找到了根本原因 每一次@load里面方法执行完毕,loading这个参数就会变成true所以就不会再次发送请求了,所以每次异步请求了数据,如果还有数据需要把loading的状态改成false

getList(){ var that = this; let query = this.query query.user_location = this.user_location getEarthquakeList(query).then(res => { this.notice.push.apply(this.notice, res.result.data); this.total = res.result.total if(this.total == this.notice.length) { this.finished = true; } else { this.finished = false this.loading = false } })
最新回复(0)