File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,10 @@ Here are some usefull public methods you can call via [`ref`](https://vuejs.org/
283
283
284
284
* ` scrollToOffset(offset) ` : manual set scroll position to a designated offset.
285
285
286
+ * ` getSize(id) ` : get the designated item size by id (from data-key value).
287
+
288
+ * ` getSizes() ` : get the total number of stored (rendered) items.
289
+
286
290
287
291
## Attentions
288
292
Original file line number Diff line number Diff line change @@ -76,6 +76,16 @@ const VirtualList = Vue.component('virtual-list', {
76
76
} ,
77
77
78
78
methods : {
79
+ // get item size by id
80
+ getSize ( id ) {
81
+ return this . virtual . sizes . get ( id )
82
+ } ,
83
+
84
+ // get the total number of stored (rendered) items
85
+ getSizes ( ) {
86
+ return this . virtual . sizes . size
87
+ } ,
88
+
79
89
// set current scroll position to a expectant offset
80
90
scrollToOffset ( offset ) {
81
91
const { root } = this . $refs
You can’t perform that action at this time.
0 commit comments