I'm using Handlebars for templating in my project.(我在我的项目中使用Handlebars进行模板化。)
Is there a way to get the index of the current iteration of an "each" helper in Handlebars?(有没有办法获得Handlebars中“每个”助手的当前迭代的索引?)
<tbody>
{{#each item}}
<tr>
<td><!--HOW TO GET ARRAY INDEX HERE?--></td>
<td>{{this.key}}</td>
<td>{{this.value}}</td>
</tr>
{{/each}}
</tbody>
ask by thunderboltz translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…