# 上啦加载实现
onReachBottom() {
this.loadmore()
},
methods: {
// 加载更多
loadmore() {
if (this.tabList[this.tabIndex].loadtext !== "上啦加载更多") {
return
}
// 修改状态
this.tabList[this.tabIndex].loadtext = "加载中。。。"
// 获取数据
setTimeout(() => {
// 获取完成
let obj = {
userpic: '../../static/demo/userpic/17.jpg',
username: '哈哈',
sex: 1, // 0 男 1 女
age: 25,
isguanzhu: true,
title: '我是标题',
titlepic: '../../static/demo/datapic/13.jpg',
video: false,
share: false,
path: '湖南 长沙',
sharenum: 20,
commentnum: 30,
goodnum: 20
}
this.tabList[this.tabIndex].list.push(obj)
this.tabList[this.tabIndex].loadtext = "上啦加载更多"
}, 1000)
// this.tabList[this.tabIndex].loadtext = "没有更多数据了"
},
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35