Skip to content

Commit b959d62

Browse files
committed
Fix #2
1 parent c72083e commit b959d62

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ If you set `contentTag` to `'table'`, the actual result in the DOM will look lik
205205
</div>
206206
```
207207

208+
## Customizing the classes
209+
210+
You can use the following props to customize the container and content elements CSS classes:
211+
212+
- `containerClass`
213+
- `contentClass`
214+
215+
208216
## Slots
209217

210218
There are 4 slots you can use to inject things inside the scroller (it may be usefull to add a `thead` or `tbody`):

dist/vue-virtual-scroller.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-virtual-scroller",
33
"description": "Smooth scrolling for any amount of data",
4-
"version": "0.5.3",
4+
"version": "0.5.4",
55
"author": {
66
"name": "Guillaume Chau",
77
"email": "[email protected]"

src/components/VirtualScroller.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<component :is="mainTag" class="virtual-scroller" :class="cssClass" @scroll="updateVisibleItems" v-observe-visibility="handleVisibilityChange">
33
<slot name="before-container"></slot>
4-
<component :is="containerTag" class="item-container" :style="itemContainerStyle">
4+
<component :is="containerTag" class="item-container" :class="containerClass" :style="itemContainerStyle">
55
<slot name="before-content"></slot>
6-
<component :is="contentTag" class="items" :style="itemsStyle">
6+
<component :is="contentTag" class="items" :class="contentClass" :style="itemsStyle">
77
<template v-if="renderers">
88
<component class="item" v-for="(item, index) in visibleItems" :key="keysEnabled && item[keyField]" :is="renderers[item[typeField]]" :item="item" :item-index="_startIndex + index"></component>
99
</template>
@@ -61,10 +61,16 @@ export default {
6161
type: String,
6262
default: 'div',
6363
},
64+
containerClass: {
65+
default: null,
66+
},
6467
contentTag: {
6568
type: String,
6669
default: 'div',
6770
},
71+
contentClass: {
72+
default: null,
73+
},
6874
pageMode: {
6975
type: Boolean,
7076
default: false,

0 commit comments

Comments
 (0)