我不知道如何使用{{first}}
和{{last}}
把助手访问数组上的嵌套属性。我有一个数组,
"test" : [{
"a" : 1,
"b" : 2
},
{
"a" : 2,
"b" : 3
}]
我尝试使用数组语法{{{{last test}}.0.a}}
但没有运气。
希望这就是你要找的。
{{#each test}}
{{#if @last}}
{{this.a}}
{{/if}}
{{/each}}
使用 http://tryhandlebarsjs.com 进行测试