Skip to content

Commit 4fc245e

Browse files
authored
Fix the error to get the offset value when loading 1 piece of data for chatroom (#386)
1 parent 24fe6f4 commit 4fc245e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ export default {
9898
this.$nextTick(() => {
9999
const vsl = this.$refs.vsl
100100
const offset = sids.reduce((previousValue, currentSid) => {
101-
const previousSize = typeof previousValue === 'string' ? vsl.getSize(previousValue) : previousValue
101+
const previousSize = typeof previousValue === 'string' && previousValue !== 0 ? vsl.getSize(previousValue) : previousValue
102102
return previousSize + this.$refs.vsl.getSize(currentSid)
103-
})
103+
}, 0)
104104
this.setVirtualListToOffset(offset)
105105
106106
this.param.isFetching = false

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy