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
}
})
转载请注明原文地址: https://lol.8miu.com/read-35889.html