Skip to content

Commit ad2665c

Browse files
committed
Support resized event
1 parent 005c045 commit ad2665c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ More usages or getting start you can refer to these clearly [examples](https://g
159159
<td>0</td>
160160
<td>Setting scroll stay offset.</td>
161161
</tr>
162+
<tr>
163+
<td><code>scroll</code></td>
164+
<td>Function</td>
165+
<td></td>
166+
<td>Emited when scrolling, param <code>(event, range)</code>.</td>
167+
</tr>
162168
<tr>
163169
<td><code>totop</code></td>
164170
<td>Function</td>
@@ -172,10 +178,10 @@ More usages or getting start you can refer to these clearly [examples](https://g
172178
<td>Emited when scrolled to bottom or right, param <code>(event, range)</code>.</td>
173179
</tr>
174180
<tr>
175-
<td><code>scroll</code></td>
181+
<td><code>resized</code></td>
176182
<td>Function</td>
177183
<td></td>
178-
<td>Emited when scrolling, param <code>(event, range)</code>.</td>
184+
<td>Emited when each item resized (mounted), param <code>(id, size)</code>.</td>
179185
</tr>
180186
</table>
181187
</details>

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const VirtualList = Vue.component('virtual-list', {
160160
// event called when each item mounted or size changed
161161
onItemResized (id, size) {
162162
this.virtual.saveSize(id, size)
163+
this.$emit('resized', id, size)
163164
},
164165

165166
// event called when slot mounted or size changed

0 commit comments

Comments
 (0)