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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,31 @@ The header slot allows you to simulate a full-page mode for the virtual-scroller
</VirtualCollection>
```

### header-inner-container
The header-inner-container slot is injected into the `div.vue-virtual-collection-container` but appears before cells. Additionally this slot is not removed from the DOM on scroll unlike the cells.

```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">

<template v-slot:header-inner-container>
<div class="filter-controls">
<!-- inject your component here -->
</div>
</template>

<div slot="cell" slot-scope="props">
{{props.data}}
</div>
</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 @@ -19,6 +19,7 @@
<div class="vue-virtual-collection" :style="outerStyle" @scroll.passive="onScroll" ref="outer">
<slot name="header"></slot>
<div class="vue-virtual-collection-container" :style="containerStyle">
<slot name="header-inner-container"></slot>
<div v-for="item in displayItems" class="cell-container" :key="item.key" :style="getComputedStyle(item)">
<slot name="cell" :data="item.data"></slot>
</div>
Expand Down