1-在使用vant 的lise 上拉加载的时候,页面进入不触发unload事件
2-上拉加载的父盒子没有设置高度
3- html结构如下
{{ item.shortname}}
{{ item.name}}
4- js数据
data数据
loading: false,
finished: false,
methods函数
onLoad () {
var that = this
setTimeout(() => {
this.$axios(
this.httpInstitutionUrl + this.afterurl.institutionList,
this.params
, 'post'
).then((res) => {
that.loading = false; //加载参数
if (res.data.code == 200) {
let data = this.institutionData
data.push(...res.data.data)
that.institutionData = data
if (res.data.data.length == 10) { //分页数为10
that.page = that.page + 1;
} else {
that.finished = true;
}
} else {
that.finished = true; //设置加载参数
that.loading = false
}
}).catch((err) => {
console.log(err, '出错了');
})
}, 500);
},