scroll.js
986 Bytes
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
36
37
38
39
40
export default {
data() {
return {
pullDownRefresh: true,
pullDownRefreshThreshold: 60,
pullDownRefreshStop: 40,
pullDownRefreshTxt: '更新成功',
pullUpLoad: true,
pullUpLoadThreshold: 0,
pullUpLoadMoreTxt: '加载更多',
pullUpLoadNoMoreTxt: '到底啦~',
customPullDown: true
};
},
computed: {
options() {
return {
pullDownRefresh: this.pullDownRefreshObj,
pullUpLoad: this.pullUpLoadObj,
scrollbar: false
};
},
pullDownRefreshObj: function() {
return this.pullDownRefresh ? {
threshold: parseInt(this.pullDownRefreshThreshold),
txt: this.pullDownRefreshTxt
} : false;
},
pullUpLoadObj: function() {
return this.pullUpLoad ? {
threshold: parseInt(this.pullUpLoadThreshold),
txt: {
more: this.pullUpLoadMoreTxt,
noMore: this.pullUpLoadNoMoreTxt
}
} : false;
}
},
};