【发布时间】:2016-11-08 21:37:39
【问题描述】:
所以我试图在我的每个循环中获取一个索引。这可能吗。这是我的代码:
@each $food, $tons-produced in $top-foods {
$i: index($top-foods, $food);
rect:nth-child(#{$i + 1}){
}
}
返回“无效的空操作:'null 加 1'。”
所以它没有索引并且 $i 为空。
我也试过$i: index($top-foods, ($food, tons-produced));
这是我正在浏览的清单:
$top-foods: ("Sugar Cane" 1898),
("Corn" 1017),
("Rice" 738),
("Wheat" 711),
("Cow Milk" 635),
("Potatoes" 374),
("Vegetables" 279),
("Soy Beans" 278),
("Cassava" 263),
("Sugar Beets" 247);
【问题讨论】:
标签: sass