Skip to content

Commit 0416d91

Browse files
committed
Update example
1 parent b8153a9 commit 0416d91

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

example/src/views/chat-room/Editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
},

example/src/views/chat-room/Main.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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
},

0 commit comments

Comments
 (0)