Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
{{first}}我不知道如何使用和{{last}}车把助手访问数组上的嵌套属性。我有一个数组, "test" : [{ "a" : 1, "b" : 2 }, { "a" : 2, "b" : 3 }] 我尝试过使用数组语法{{{{last test}}.0.a}}但没有运气。
{{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测试