Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Vue component for efficiently rendering large collection data. Inspired by [reac
- [scrolled-to-bottom-range](#scrolled-to-bottom-range)
- [Slots](#slots)
- [header](#header)
- [footer](#footer)
- [cell](#cell)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -344,6 +345,29 @@ The header slot allows you to simulate a full-page mode for the virtual-scroller
</VirtualCollection>
```

### footer
You can add content at the footer of the component by using footer slot

```html
<VirtualCollection
:cellSizeAndPositionGetter="item => { return { width: item.width, height: item.height, x: item.x, y: item.y }}"
:collection="items.items"
:height="items.boxHeight"
:width="items.boxWidth"
:containerHeightSpacer="50"
v-on:scrolled-to-top="scrollTop"
v-on:scrolled-to-bottom="scrollBottom">
<div slot="cell" slot-scope="props">
{{props.data}}
</div>
<template v-slot:footer>
<div>
This content will sit on bottom of the scrollable items acting as a footer.
</div>
</template>
</VirtualCollection>
```

### cell
```html
<div slot="cell" slot-scope="yourOwnScope">{{yourOwnScope.data.text}}</div>
Expand Down
1 change: 1 addition & 0 deletions src/VirtualCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<slot name="cell" :data="item.data"></slot>
</div>
</div>
<slot name="footer"></slot>
</div>
</template>

Expand Down