Skip to content

Commit 75846ff

Browse files
committed
Update README.md
1 parent 95a8ee2 commit 75846ff

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,26 +191,63 @@ According to the demos above, here are lists of approximate statistics:
191191

192192
<img height="256" src="https://tangbc.github.io/github-images/vitual-scroll-list-prop-type.png">
193193

194+
> Props of basic:
195+
194196
| Prop | Type | Required | Description |
195197
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
196198
| size | Number || Each list item height, in variable height, this prop just use to calculate the virtual-list outside container viewport fixed height. |
197199
| remain | Number || How many items should be shown in virtual-list viewport, so `size` and `remain` determine the outside container viewport height (`size × remian`). |
200+
201+
> Props of performance:
202+
203+
| Prop | Type | Required | Description |
204+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
198205
| 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. |
206+
| 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. |
207+
208+
> Props of position:
209+
210+
| Prop | Type | Required | Description |
211+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
199212
| 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. |
200213
| offset | Number | * | Default value is `0`, the initial scroll offset. If both `start` and `offset` are assigned at initialization, `start` is preferred. |
201-
| 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. |
202-
| rtag | String | * | Default value is `div`, the virtual-list root element tag name, in all cases it's style is set to `display: block;` |
203-
| 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;` |
204-
| wclass | String | * | Default is no classname, 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). |
205-
| pagemode | Boolean | * | Let virtual-list scroll with page viewport. |
206-
| scrollelement | HTMLElement | * | Let virtual-list scroll with a parent element. Note: to scroll with page viewport, use pagemode instead. When pagemode is true, scrollelement is ignored. |
214+
215+
> Props of element and class:
216+
217+
| Prop | Type | Required | Description |
218+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
219+
| rtag | String | * | Default value is `div`, virtual-list root element tag name, in all cases it's style is set to `display: block;` |
220+
| wtag | String | * | Default value is `div`, virtual-list item wrapper element tag name, in all cases it's style is set to `display: block;` |
221+
| wclass | String | * | Default is no classname, 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). |
222+
223+
> Props of scroll mode:
224+
225+
| Prop | Type | Required | Description |
226+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
227+
| pagemode | Boolean | * | Let virtual-list scroll with window page viewport. |
228+
| scrollelement | HTMLElement | * | Let virtual-list scroll with a parent element. When `pagemode` is true, `scrollelement` is ignored. |
229+
230+
> Props of scroll event:
231+
232+
| Prop | Type | Required | Description |
233+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
207234
| totop | Function | * | Called when virtual-list is scrolled to top, no param. |
208235
| tobottom | Function | * | Called when virtual-list is scrolled to bottom, no param. |
209236
| 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). |
210-
| variable | Function or Boolean | * | Used in variable height, 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. |
211-
| item | Component | * | Using in `item-mode`, list item vue component. |
212-
| itemcount | Number | * | Using in `item-mode`, list data total counts. |
213-
| itemprops | Function | * | Using in `item-mode`, a function call when each item is going to be rendered. |
237+
238+
> Props of variable height:
239+
240+
| Prop | Type | Required | Description |
241+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
242+
| variable | Function or Boolean | * | 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. |
243+
244+
> Props of item-mode:
245+
246+
| Prop | Type | Required | Description |
247+
|---------------|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
248+
| item | Component | * | List item vue component or vNode. |
249+
| itemcount | Number | * | List total count, you should update this prop when source data changed. |
250+
| itemprops | Function | * | A function call when each item is going to be rendered, you can assign props or data to each item component in this function. |
214251

215252

216253
## Public methods

0 commit comments

Comments
 (0)