Skip to content

Commit 8267ad8

Browse files
committed
Update readme.
1 parent 96290e5 commit 8267ad8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
1616
* Tiny and very easy to use.
1717

18-
* Big data list and infinite loading with high performance.
18+
* Big data list with high performance.
19+
20+
* Support fixed height and variable height.
1921

2022
* Support set the initial scroll index or change any.
2123

@@ -26,7 +28,9 @@
2628

2729
* [vue-virtual-scroll-list with 100,000 finite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/finite/).
2830

29-
* [vue-virtual-scroll-list infinite data by request 20 each time](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/).
31+
* [vue-virtual-scroll-list with requesting infinite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/).
32+
33+
* [vue-virtual-scroll-list with variable height](https://tangbc.github.io/vue-virtual-scroll-list/examples/variable-height/).
3034

3135

3236
## How it works
@@ -42,7 +46,7 @@
4246
npm install vue-virtual-scroll-list --save
4347
```
4448

45-
```javascript
49+
```vue
4650
<template>
4751
<div>
4852
<virtualList :size="40" :remain="8">
@@ -76,8 +80,8 @@ The `<Item>` component is included inside but defined outside the `<virtualList>
7680
<script src="https://tangbc.github.io/vue-virtual-scroll-list/index.js"></script>
7781

7882
<div id="app">
79-
<virtual-list :size="40" :remain="8">
80-
<div class="item" v-for="(item, index) of items" :key="index">Item: # {{ index }}</div>
83+
<virtual-list :size="40" :remain="8" wtag="ul">
84+
<li class="item" v-for="(item, index) of items" :key="index">Item: # {{ index }}</li>
8185
</virtual-list>
8286
</div>
8387
```
@@ -114,12 +118,12 @@ new Vue({
114118
| start | Number | * | Default value is `0`, the initial scroll start index. It must be integer and in the range of list index, throws a warning if index does not exist. |
115119
| debounce | Number | * | **It's disabled by default**, milliseconds of using `debounce` function to ensure scroll event doesn't fire so often that it bricks browser performance. |
116120
| rtag | String | * | Default value is `div`, the virtual-list root HTMLElement tag name, in all case it's style is set to `display: block;` |
117-
| rclass | String | * | Default value is an empty string, the virtual-list root HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
118121
| wtag | String | * | Default value is `div`, the virtual-list item wrapper HTMLElement tag name, in all case it's style is set to `display: block;` |
119-
| wclass | String | * | Default value is an empty string, the virtual-list item wrapper HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
122+
| wclass | String | * | Default value is an empty string, the virtual-list item wrapper HTMLElement tag's classes. Has the same API with [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
120123
| onscroll | Function | * | Called when virtual-list scroll event handling, param: `(e, scrollTop)`. |
121124
| totop | Function | * | Called when the virtual-list is scrolled to top. |
122125
| tobottom | Function | * | Called when the virtual-list is scrolled to bottom. |
126+
| variable | Function | * | For using virtual-list with variable height, this props is a variable height getter function which is called with param: `(index)` when each item is ready to be calculated. |
123127

124128

125129
## Contributions

0 commit comments

Comments
 (0)