File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
example/src/views/chat-room Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export default {
55
55
},
56
56
57
57
mounted () {
58
- if (this .$refs .rich ) {
58
+ if (this .$refs .rich && ! isMobile ) {
59
59
this .$refs .rich .focus ()
60
60
}
61
61
},
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ export default {
65
65
this .param = {
66
66
pageSize: loadType === LOAD_TYPES .FEW ? 2 : 10 ,
67
67
isFirstPageReady: false ,
68
+ isFetching: false
68
69
}
69
70
70
71
this .finished = loadType !== LOAD_TYPES .PAGES
@@ -77,17 +78,15 @@ export default {
77
78
}
78
79
},
79
80
80
- // mounted () {
81
- // window.vsl = this.$refs.vsl
82
- // },
83
-
84
81
methods: {
85
82
onTotop () {
86
83
// only page type has paging
87
- if (getLoadType () !== LOAD_TYPES .PAGES ) {
84
+ if (getLoadType () !== LOAD_TYPES .PAGES || this . param . isFetching ) {
88
85
return
89
86
}
90
87
88
+ this .param .isFetching = true
89
+
91
90
// get next page
92
91
getMessages (this .param .pageSize , true ).then ((messages ) => {
93
92
if (! messages .length ) {
@@ -106,6 +105,8 @@ export default {
106
105
return previousSize + this .$refs .vsl .getSize (currentSid)
107
106
})
108
107
this .setVirtualListToOffset (offset)
108
+
109
+ this .param .isFetching = false
109
110
})
110
111
})
111
112
},
You can’t perform that action at this time.
0 commit comments