我对SASS非常陌生,我很难理解这两种说法之间的区别:
@for $i from 1 through 3与
@for $i from 1 to 3发布于 2019-10-18 10:40:52
在这里,您可以阅读差异:https://sass-lang.com/documentation/at-rules/control/for
...如果使用to,则排除最终数字;如果使用通过的,则包括该数字。
然后,当您使用through时
@for $i from 1 through 3{
div{
content:$i;
}
}您可以创建以下输出:
div {
content: 1;
}
div {
content: 2;
}
div {
content: 3;
}相反,使用to
@for $i from 1 to 3{
div{
content:$i;
}
}您可以创建以下输出:
div {
content: 1;
}
div {
content: 2;
}https://stackoverflow.com/questions/58448510
复制相似问题