Skip to content

Commit c94e9be

Browse files
committed
Update readme.
1 parent 1eab69f commit c94e9be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
* [vue-virtual-scroll-list with requesting infinite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/).
3232

33-
* [vue-virtual-scroll-list with variable height](https://tangbc.github.io/vue-virtual-scroll-list/examples/variable-height/).
33+
* [vue-virtual-scroll-list with variable height](https://tangbc.github.io/vue-virtual-scroll-list/examples/variable/).
3434

3535

3636
## How it works
@@ -120,11 +120,15 @@ new Vue({
120120
| rtag | String | * | Default value is `div`, the virtual-list root HTMLElement tag name, in all case it's style is set to `display: block;` |
121121
| 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;` |
122122
| 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) |
123-
| onscroll | Function | * | Called when virtual-list scroll event handling, param: `(e, scrollTop)`. |
123+
| onscroll | Function | * | Called when virtual-list scroll event handling, param: `(e, { start, end, offset })`. |
124124
| totop | Function | * | Called when the virtual-list is scrolled to top. |
125125
| tobottom | Function | * | Called when the virtual-list is scrolled to bottom. |
126126
| 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. |
127127

128+
### About variable height
129+
130+
In variable height mode, `size` is still required. All the index variable height and scroll offset will be cached by virtual-list after the binary-search calculate, if you want to change any `<Item/>` height from data, you should call virtual-list's `updateVariable(index)` method to clear the offset cached, refer to [variable example](https://github.com/tangbc/vue-virtual-scroll-list/blob/master/examples/variable/variable.vue#L1) source for more detail.
131+
128132

129133
## Contributions
130134

0 commit comments

Comments
 (0)