Skip to content

Commit 3cf3e69

Browse files
committed
Update readme
1 parent b2d6c18 commit 3cf3e69

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Root component:
6464
<template>
6565
<div>
6666
<virtual-list
67-
:size="60" // You dont know? no problem, just assign a estimate value!
67+
:size="60" // You dont know? no problem, just pass a estimate value!
6868
:keeps="30"
6969
:data-key="'uid'"
7070
:data-sources="items"
@@ -102,6 +102,9 @@ Item component:
102102
export default {
103103
name: 'item-component',
104104
props: {
105+
index: { // index of current item
106+
type: Number
107+
},
105108
source: { // here is: {uid: 'unique_1', text: 'abc'}
106109
type: Object,
107110
default () {
@@ -123,7 +126,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
123126

124127
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;** | **Type** | **Description** |
125128
|------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
126-
| `size` | Number | Each item size, you don't have to know the accurate, just simply assign an **estimate** or **average** value. |
129+
| `size` | Number | Each item size, you don't have to know the accurate, just simply pass an **estimate** or **average** value. |
127130
| `keeps` | Number | How many items you are expecting the list to keep rendering in the real dom. |
128131
| `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. |
129132
| `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. |
@@ -136,7 +139,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
136139
<p></p>
137140
<table>
138141
<tr>
139-
<th>Props</th>
142+
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Props&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
140143
<th>Type</th>
141144
<th>Default</th>
142145
<th>Description</th>
@@ -145,7 +148,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
145148
<td><code>extra-props</code></td>
146149
<td>Object</td>
147150
<td>{}</td>
148-
<td>Extra props assign to item component.</td>
151+
<td>Extra props pass to item component, notice: <code>index</code> and <code>source</code> are both occupied.</td>
149152
</tr>
150153
<tr>
151154
<td><code>scroll</code></td>
@@ -157,13 +160,13 @@ More usages or getting start you can refer to these clearly [examples](https://g
157160
<td><code>totop</code></td>
158161
<td>Event</td>
159162
<td></td>
160-
<td>Emited when scrolled to top or left, param <code>(event, range)</code>.</td>
163+
<td>Emited when scrolled to top or left, no param.</td>
161164
</tr>
162165
<tr>
163166
<td><code>tobottom</code></td>
164167
<td>Event</td>
165168
<td></td>
166-
<td>Emited when scrolled to bottom or right, param <code>(event, range)</code>.</td>
169+
<td>Emited when scrolled to bottom or right, no param.</td>
167170
</tr>
168171
</table>
169172
</details>

0 commit comments

Comments
 (0)