例如,我有以下数据集
dataset = {header: ' header' }
dateline = { content: 'list of dates' }
monday = [
{ food:'teacake' , drink:'orange' }
]
tuesday = [
{ food:'eggs' , drink:'beer' }
]
dateline.monday = monday
dateline.tuesday = tuesday
dataset.dateline = dateline
我想要做的是使用把手来运行,我认为这可以使用 child 来完成。
<script id="mwl707" type="text/x-handlebars-template">
{{#each dateline.children }}
<span>{{food}} : {{drink}}</span>
{{/each}}
</script>
但我不能让它工作,有什么帮助吗? JSfiddle