Handlebars:
Template
{{!-- wrong: {{array.0.item}} --}}
correct: array.[0].item: {{array.[0].item}}

{{!-- wrong: {{array.[0].item-class}} --}}
correct: array.[0].[item-class]: {{array.[0].[item-class]}}

{{!-- wrong: {{./true}}--}}
correct: ./[true]: {{./[true]}}
Preparation-Script
// Handlebars.registerHelper('loud', function(string) {
//    return string.toUpperCase()
// });
Input
{
  array: [
    {
      item: "item1",
      "item-class": "class1",
    },
  ],
  true: "yes",
}
Output
correct: array.[0].item: item1

correct: array.[0].[item-class]: class1

correct: ./[true]: yes
最后更新: 1/11/2020, 3:46:21 PM