//控制加载参数
loading: false,//加载
finished: false,//加载结束,没有更多了
refreshing: false,//刷新
list: [],//数据
//加载数据
loadPost() {
if (this.refreshing) {
this.list = []
this.refreshing = false
}
get('/getArticleList/', this.query, {
Type: this.type,
Id: this.type == 'project' ? this.pid : this.bid
}).then(res => {
console.log(res)
this.loading = false
if (res.data.length == 0) {
console.log('加载完了')
this.finished = true
return false;
}
this.list = this.list.concat(res.data)
this.query.page++
})
}
//刷新
onRefresh() {
// 清空列表数据
console.log('刷新')
this.finished = false
this.query.page = 1
this.loading = true
this.loadPost()
}