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 {
5555 },
5656
5757 mounted () {
58- if (this .$refs .rich ) {
58+ if (this .$refs .rich && ! isMobile ) {
5959 this .$refs .rich .focus ()
6060 }
6161 },
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ export default {
6565 this .param = {
6666 pageSize: loadType === LOAD_TYPES .FEW ? 2 : 10 ,
6767 isFirstPageReady: false ,
68+ isFetching: false
6869 }
6970
7071 this .finished = loadType !== LOAD_TYPES .PAGES
@@ -77,17 +78,15 @@ export default {
7778 }
7879 },
7980
80- // mounted () {
81- // window.vsl = this.$refs.vsl
82- // },
83-
8481 methods: {
8582 onTotop () {
8683 // only page type has paging
87- if (getLoadType () !== LOAD_TYPES .PAGES ) {
84+ if (getLoadType () !== LOAD_TYPES .PAGES || this . param . isFetching ) {
8885 return
8986 }
9087
88+ this .param .isFetching = true
89+
9190 // get next page
9291 getMessages (this .param .pageSize , true ).then ((messages ) => {
9392 if (! messages .length ) {
@@ -106,6 +105,8 @@ export default {
106105 return previousSize + this .$refs .vsl .getSize (currentSid)
107106 })
108107 this .setVirtualListToOffset (offset)
108+
109+ this .param .isFetching = false
109110 })
110111 })
111112 },
You can’t perform that action at this time.
0 commit comments