-
Notifications
You must be signed in to change notification settings - Fork 0
For loops
ro edited this page May 12, 2022
·
2 revisions
For loops can be done with the <for> tag. Currently, as of version 1.1.0, for tags can only be used to loop through children in an element.
<div class="parent">
<div class="child">H</div>
<div class="child">e</div>
<div class="child">l</div>
<div class="child">l</div>
<div class="child">o</div>
<div class="child">!</div>
</div>
<for each=".child" in=".parent" varname="item">{{item}}</for>
<!-- Expected Output -->
Hello!<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
<for each=".child" in=".parent">{{i}}</for>
<!-- Expected Output -->
01234If anything on this wiki feels to be out of date, feel free to submit an issue. :D