vue-virtual-scroller
vue-virtual-scroller copied to clipboard
Vue 3 DynamicScrollerItem default slot issue
trafficstars
When attempting to implement the DynamicScroller in Vue 3, I'm getting a TypeError: this.$slots.default is not a function exception when I attempt to render the DynamicScrollerItem component. If I remove the component, the exception goes away.
<DynamicScroller
:items="filteredLocations"
:min-item-size="100"
key-field="uuid"
>
<template v-slot="{ item, index, active }">
<DynamicScrollerItem
:item="item"
:active="active"
:size-dependencies="[
item.properties.name,
item.properties.address,
]"
:data-index="index"
>
<div>{{item.uuid}}</div>
</DynamicScrollerItem>
</template>
</DynamicScroller>
Using version 2.0.0-alpha.1.
I got the same issue when trying to use 2.0.0-alpha.1.
My code:
<dynamic-scroller
:items="flatNodes"
:min-item-size="18"
class="w-4/4 h-4/4"
>
<template #default="{ item, index, active }">
<dynamic-scroller-item
:item="item"
:active="active"
:data-index="index"
:data-active="active"
>
<div>
{{ index }} - {{ active }}
</div>
</dynamic-scroller-item>
</template>
</dynamic-scroller>
Error on console:

I think PR #666 could fix this issue
did this issue ever get solved?