本文介绍了Meteor Handlebars:如何访问普通数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var plain_array = [1, 2, 3, 4, 5, 6, 7]
如何在 Meteor Handlebars 中显示所有元素?
How can I show all elements in Meteor Handlebars?
{{#each plain_array}}
# What to put here to get the elements?
{{/each}}
(这个问题类似:handlebars: how to access an array? 但与假设对象数组的另一个问题不同.)
(This question is similar: handlebars: how to access an array? but not the same as the other question presumes an array of objects.)
推荐答案
来自 Handlebars 文档.
{{#each people}}
<li>{{this}}</li>
{{/each}}
这篇关于Meteor Handlebars:如何访问普通数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!