You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-2Lines changed: 65 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,10 @@
23
23
*[Using by script include](#using-by-script-include)
24
24
*[Attentions](#attentions)
25
25
*[Props type](#props-type)
26
+
*[Public methods](#public-methods)
26
27
*[Special scenes](#special-scenes)
27
28
*[About variable height](#about-variable-height)
29
+
*[About item mode](#about-item-mode)
28
30
*[Contributions](#contributions)
29
31
*[Changelogs](#changelogs)
30
32
@@ -60,7 +62,7 @@
60
62
61
63
#### Using by npm module:
62
64
63
-
```
65
+
```console
64
66
npm install vue-virtual-scroll-list --save
65
67
```
66
68
@@ -140,7 +142,19 @@ new Vue({
140
142
| totop | Function | * | Called when virtual-list is scrolled to top, no param. |
141
143
| tobottom | Function | * | Called when virtual-list is scrolled to bottom, no param. |
142
144
| 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). |
143
-
| 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. |
145
+
| 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. |
146
+
| item | Component | * | For using virtual-list with `item mode` see [details](#about-item-mode) below. |
147
+
| itemdata | Array | * | For using virtual-list with `item mode` see [details](#about-item-mode) below |
148
+
| itemprop | Function | * | For using virtual-list with `item mode` see [details](#about-item-mode) below. |
149
+
150
+
151
+
## Public methods
152
+
153
+
Here are some usefull public methods if you can call via [`ref`](https://vuejs.org/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements):
154
+
155
+
*`forceRender()`: force render virtual-list if you need or make it refresh.
156
+
157
+
*`updateVariable(index)`: update variable by index in variable height mode.
144
158
145
159
146
160
## Special scenes
@@ -160,6 +174,55 @@ If you are using `variable` assign by `Boolean`, **do not** set inline style hei
160
174
</template>
161
175
```
162
176
177
+
### About item mode
178
+
179
+
Use item mode can save a considerable amount of memory, stats can see [#87](https://github.com/tangbc/vue-virtual-scroll-list/pull/87).
180
+
181
+
In this mode prop `item`, `itemdata` and `itemprop` is both required, you don't need put `<item/>` inside `virtual-list` just assign it as prop `item`:
182
+
183
+
*`item`: The list vue item component.
184
+
185
+
*`itemdata`: The prop data list assign to each item.
186
+
187
+
*`itemprop`: Call when each item is going to be rendered.
0 commit comments