문제

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