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
|`size`| Number | Each item size, you don't have to know the accurate, just simply pass an **estimate** or **average** value. |
132
-
|`keeps`| Number | How many items you are expecting the list to keep rendering in the real dom. |
133
129
|`data-key`| String | The unique key get from `data-sources` in each data object, its value **must be unique** in `data-sources`, it is used for identifying item size. |
134
130
|`data-sources`| Array[Object]| The source array built for list, each array data must be an object and has an unique key for `data-key` property. |
135
131
|`data-component`| Component | The render item component created / declared by vue, and it will use the data object in `datas-sources` as render prop and named: `source`. |
@@ -141,34 +137,28 @@ More usages or getting start you can refer to these clearly [examples](https://g
<td>How many items you are expecting the virtual list to keep rendering in the real dom.</td>
150
+
</tr>
149
151
<tr>
150
152
<td><code>extra-props</code></td>
151
153
<td>Object</td>
152
154
<td>{}</td>
153
-
<td>Extra props pass to item component, notice: <code>index</code> and <code>source</code> are both occupied.</td>
155
+
<td>Extra props assign to item component that are not in <code>data-sources</code>. Notice: <code>index</code> and <code>source</code> are both occupied inner.</td>
154
156
</tr>
155
157
<tr>
156
-
<td><code>scroll</code></td>
157
-
<td>Event</td>
158
-
<td></td>
159
-
<td>Emited when scrolling, param <code>(event, range)</code>.</td>
160
-
</tr>
161
-
<tr>
162
-
<td><code>totop</code></td>
163
-
<td>Event</td>
164
-
<td></td>
165
-
<td>Emited when scrolled to top or left, no param.</td>
166
-
</tr>
167
-
<tr>
168
-
<td><code>tobottom</code></td>
169
-
<td>Event</td>
170
-
<td></td>
171
-
<td>Emited when scrolled to bottom or right, no param.</td>
158
+
<td><code>estimate-size</code></td>
159
+
<td>Number</td>
160
+
<td>50</td>
161
+
<td>The estimate size of each item, if it is closer to the average size, the scrollbar length looks more accurately. It is recommended to assign the average that calculate by yourself.</td>
172
162
</tr>
173
163
</table>
174
164
</details>
@@ -187,13 +177,31 @@ More usages or getting start you can refer to these clearly [examples](https://g
187
177
<td><code>start</code></td>
188
178
<td>Number</td>
189
179
<td>0</td>
190
-
<td>Setting scroll stay start index.</td>
180
+
<td>Setting scroll position stay start index.</td>
191
181
</tr>
192
182
<tr>
193
183
<td><code>offset</code></td>
194
184
<td>Number</td>
195
185
<td>0</td>
196
-
<td>Setting scroll stay offset.</td>
186
+
<td>Setting scroll position stay offset.</td>
187
+
</tr>
188
+
<tr>
189
+
<td><code>scroll</code></td>
190
+
<td>Event</td>
191
+
<td></td>
192
+
<td>Emited when scrolling, param <code>(event, range)</code>.</td>
193
+
</tr>
194
+
<tr>
195
+
<td><code>totop</code></td>
196
+
<td>Event</td>
197
+
<td></td>
198
+
<td>Emited when scrolled to top or left, no param.</td>
199
+
</tr>
200
+
<tr>
201
+
<td><code>tobottom</code></td>
202
+
<td>Event</td>
203
+
<td></td>
204
+
<td>Emited when scrolled to bottom or right, no param.</td>
197
205
</tr>
198
206
<tr>
199
207
<td><code>resized</code></td>
@@ -284,25 +292,53 @@ More usages or getting start you can refer to these clearly [examples](https://g
284
292
285
293
### Public methods
286
294
287
-
Here are some usefull public methods you can call via [`ref`](https://vuejs.org/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements):
288
-
289
-
*`reset()`: reset all state back to initial.
290
-
291
-
*`scrollToBottom()`: manual set scroll position to bottom.
292
-
293
-
*`scrollToIndex(index)`: manual set scroll position to a designated index.
294
-
295
-
*`scrollToOffset(offset)`: manual set scroll position to a designated offset.
296
-
297
-
*`getSize(id)`: get the designated item size by id (from data-key value).
298
-
299
-
*`getSizes()`: get the total number of stored (rendered) items.
300
-
301
-
*`getOffset()`: get current scroll offset.
302
-
303
-
*`getClientSize()`: get wrapper element client viewport size (width or height).
304
-
305
-
*`getScrollSize()`: get all scroll size (scrollHeight or scrollWidth).
295
+
<details>
296
+
<summary><strong>Usefull public methods</strong></summary>
297
+
<p></p>
298
+
<p>You can call these methods via <code><ahref="https://vuejs.org/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements">ref</a></code>:</p>
299
+
<table>
300
+
<tr>
301
+
<th>Method</th>
302
+
<th>Description</th>
303
+
</tr>
304
+
<tr>
305
+
<td><code>reset()</code></td>
306
+
<td>Reset all state back to initial.</td>
307
+
</tr>
308
+
<tr>
309
+
<td><code>scrollToBottom()</code></td>
310
+
<td>Manual set scroll position to bottom.</td>
311
+
</tr>
312
+
<tr>
313
+
<td><code>scrollToIndex(index)</code></td>
314
+
<td>Manual set scroll position to a designated index.</td>
315
+
</tr>
316
+
<tr>
317
+
<td><code>scrollToOffset(offset)</code></td>
318
+
<td>Manual set scroll position to a designated offset.</td>
319
+
</tr>
320
+
<tr>
321
+
<td><code>getSize(id)</code></td>
322
+
<td>Get the designated item size by id (from `data-key` value).</td>
323
+
</tr>
324
+
<tr>
325
+
<td><code>getSizes()</code></td>
326
+
<td>Get the total number of stored (rendered) items.</td>
327
+
</tr>
328
+
<tr>
329
+
<td><code>getOffset()</code></td>
330
+
<td>Get current scroll offset.</td>
331
+
</tr>
332
+
<tr>
333
+
<td><code>getClientSize()</code></td>
334
+
<td>Get wrapper element client viewport size (width or height).</td>
335
+
</tr>
336
+
<tr>
337
+
<td><code>getScrollSize()</code></td>
338
+
<td>Get all scroll size (scrollHeight or scrollWidth).</td>
0 commit comments