Skip to content

Commit 8a2b94a

Browse files
committed
fixup! fix(ConversationsListVirtual): migrate to useVirtualList from vueuse/core
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 64f3b31 commit 8a2b94a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/LeftSidebar/ConversationsList/ConversationsListVirtual.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const props = defineProps<{
2727
const itemHeight = computed(() => props.compact ? 28 + 2 * 2 : AVATAR.SIZE.DEFAULT + 2 * 4 + 2 * 2)
2828
2929
const { list, containerProps, wrapperProps } = useVirtualList<Conversation>(toRef(() => props.conversations), {
30-
itemHeight: itemHeight.value,
30+
itemHeight: () => itemHeight.value,
3131
overscan: 10,
3232
})
3333
@@ -113,16 +113,19 @@ defineExpose({
113113
</script>
114114

115115
<template>
116-
<li v-bind="containerProps">
116+
<li
117+
:ref="containerProps.ref"
118+
:style="containerProps.style"
119+
@scroll="containerProps.onScroll">
117120
<LoadingPlaceholder v-if="loading" type="conversations" />
118121
<ul
119122
v-else
120-
v-bind="wrapperProps">
123+
:style="wrapperProps.style">
121124
<ConversationItem
122125
v-for="item in list"
123126
:key="item.data.id"
124127
:item="item.data"
125-
:compact="compact" />
128+
:compact />
126129
</ul>
127130
</li>
128131
</template>

0 commit comments

Comments
 (0)