I try to write a While loop in Rythm within HTML tags but I can't

something like this code:

@{
int i = 0;
while( i< 5){
i++;
}

<h2>hello</h2>

@{
}
}
有帮助吗?

解决方案

At the moment Rythm does not support while loop. Use for loop instead for your case:

@for(int i = 0; i < 5; ++i) {
    <h2>hello</h2>
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top