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
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,28 @@ With a surrounding fixed height container with overflow scroll. Note that `overf
86
86
87
87
If you are running the plugin in the `skeleton-naviagion` project, make sure to remove `overflow-x: hidden;` and `overflow-y: auto;` from `.page-host` in `styles.css`.
88
88
89
+
#### infinite scroll
90
+
```html
91
+
<template>
92
+
<divvirtual-repeat.for="item of items"virtual-repeat-next="getMore">
93
+
${$index} ${item}
94
+
</div>
95
+
</template>
96
+
```
97
+
98
+
```javascript
99
+
exportclassMyVirtualList {
100
+
items = ['Foo', 'Bar', 'Baz'];
101
+
getMore() {
102
+
for(let i =0; i <100; ++i) {
103
+
this.items.push('item'+ i);
104
+
}
105
+
}
106
+
}
107
+
```
108
+
The `virtual-repeat-next` attribute can accept a function, a promise, or a function that returns a promise.
109
+
The bound function will be called when the scroll container has reached a point where there are no more items to move into the DOM (i.e. when it reaches the end of a list).
0 commit comments