如何获取 Meteor 中 {{#each}} 列表的索引号?看起来应该很简单,但是我找不到。
最佳答案
目前没有对此的内置支持。如果您迭代光标,请使用:
return Collection.find().map(function (doc, index, cursor) {
return _.extend(doc, {index: index + 1});
})
并使用
{{#each .}}
{{index}}
{{/each}}
关于javascript - 如何获取 Meteor {{#each}} 上的迭代次数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30829914/