Skip to content

Commit c4f30fb

Browse files
committed
doc(readme): add example of workaround in caveat doc
1 parent 2e70e7d commit c4f30fb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,18 @@ There are three parameters that are passed to the function (`getMore(topIndex, i
135135
## Caveats
136136

137137
1. `<template/>` is not supported as root element of a virtual repeat template. This is due to the requirement of aurelia ui virtualization technique: item height needs to be calculatable. With `<tempate/>`, there is no easy and performant way to acquire this value.
138-
2. Similar to (1), other template controllers cannot be used in conjunction with `virtual-repeat`, unline `repeat`. I.e: built-in template controllers: `with`, `if`, `replaceable` cannot be used with `virtual-repeat`.
138+
2. Similar to (1), other template controllers cannot be used in conjunction with `virtual-repeat`, unline `repeat`. I.e: built-in template controllers: `with`, `if`, `replaceable` cannot be used with `virtual-repeat`. This can be workaround'd by nesting other template controllers inside the repeated element, with `<template/>` element, for example:
139+
140+
```html
141+
<template>
142+
<h1>${message}</h1>
143+
<div virtual-repeat.for="person of persons">
144+
<template with.bind="person">
145+
${Name}
146+
</template>
147+
</div>
148+
</template>
149+
```
139150

140151
## [Demo](http://aurelia.io/ui-virtualization/)
141152

0 commit comments

Comments
 (0)