|
10 | 10 | <a href="http://packagequality.com/#?package=vue-virtual-scroll-list">
|
11 | 11 | <img src="http://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
|
12 | 12 | </a>
|
13 |
| -<a href="https://github.com/tangbc/vue-virtual-scroll-list/blob/master/LICENSE"> |
14 |
| - <img src="https://img.shields.io/github/license/tangbc/vue-virtual-scroll-list.svg" alt="MIT License"/> |
15 |
| -</a> |
16 | 13 |
|
17 | 14 |
|
18 | 15 | ## vue-virtual-scroll-list
|
|
25 | 22 |
|
26 | 23 | * Support fixed height and variable height.
|
27 | 24 |
|
28 |
| -* Support set the initial scroll index or change any. |
| 25 | +* Support set the initial scroll index or offset. |
29 | 26 |
|
30 |
| -* Event scrolling, reach top and bottom can be detected. |
| 27 | +* Event scroll, reach top and bottom can be detected. |
31 | 28 |
|
32 | 29 |
|
33 | 30 | ## Live demos
|
34 | 31 |
|
35 | 32 | * [vue-virtual-scroll-list with 100,000 finite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/finite/).
|
36 | 33 |
|
37 |
| -* [vue-virtual-scroll-list with requesting infinite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/). |
| 34 | +* [vue-virtual-scroll-list with request infinite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/). |
38 | 35 |
|
39 |
| -* [vue-virtual-scroll-list with variable height](https://tangbc.github.io/vue-virtual-scroll-list/examples/variable/). |
| 36 | +* [vue-virtual-scroll-list with variable height mode](https://tangbc.github.io/vue-virtual-scroll-list/examples/variable/). |
40 | 37 |
|
41 | 38 |
|
42 | 39 | ## How it works
|
@@ -118,15 +115,16 @@ new Vue({
|
118 | 115 | :--- | :--- | :--- | :--- |
|
119 | 116 | | size | Number | ✓ | Each list item height, in variable height mode, this prop just use to calculate the virtual-list outside container viewport height. |
|
120 | 117 | | remain | Number | ✓ | How many items should be shown in virtual-list viewport, so `size` and `remain` determine the outside container viewport height (size × remian). |
|
121 |
| -| start | Number | * | Default value is `0`, the initial scroll start index. It must be integer and in the range of list index, if out of range it will be turned to `0` or the last one. | |
| 118 | +| start | Number | * | Default value is `0`, the initial scroll start index. It must be integer and in the range of list index, if invalid there will be effected as `0` or the last one. | |
| 119 | +| offset | Number | * | Default value is `0`, the initial scroll offset. If both `start` and `offset` are assigned at initialization, `start` is preferred. | |
122 | 120 | | bench | Number | * | Default value is equal to `remain`, unreached items count, not show in virtual-list viewport but exist in real DOM, the larger the bench, the higher the scroll performance will achieved. |
|
123 | 121 | | 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. |
|
124 | 122 | | rtag | String | * | Default value is `div`, the virtual-list root element tag name, in all cases it's style is set to `display: block;` |
|
125 | 123 | | wtag | String | * | Default value is `div`, the virtual-list item wrapper element tag name, in all cases it's style is set to `display: block;` |
|
126 | 124 | | wclass | String | * | Default value is an empty string, the virtual-list item wrapper element class, if assign this prop, you better **not** to change it's [CSS box model](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model). |
|
127 | 125 | | totop | Function | * | Called when virtual-list is scrolled to top, no param. |
|
128 | 126 | | tobottom | Function | * | Called when virtual-list is scrolled to bottom, no param. |
|
129 |
| -| onscroll | Function | * | Called when virtual-list is scrolling, param: `(e, { offset, offsetAll, start, end })`. | |
| 127 | +| onscroll | Function | * | Called when virtual-list is scrolling, with param: [`(event, data)`](https://github.com/tangbc/vue-virtual-scroll-list/releases/tag/v1.1.7). | |
130 | 128 | | variable | Function or Boolean | * | For using virtual-list with variable height mode. If assign `Function`, this prop is a variable height getter function which is called with param: `(index)` when each item is ready to be calculated. If assign `Boolean`, virtual-list will get each item variable height by it's inline style height automatic. |
|
131 | 129 |
|
132 | 130 | ### About variable height
|
|
0 commit comments