Handlebars:
Template
{{#each people}}
  {{> myPartial prefix=../prefix firstname=firstname lastname=lastname}}.
{{/each}}
myPartial
[rename] [delete]
{{prefix}}, {{firstname}} {{lastname}}
Preparation-Script
// Handlebars.registerHelper('loud', function(string) {
//    return string.toUpperCase()
// });
Input
{
  people: [
    {
      firstname: "Nils",
      lastname: "Knappmeier",
    },
    {
      firstname: "Yehuda",
      lastname: "Katz",
    },
  ],
  prefix: "Hello",
}
Output
  Hello, Nils Knappmeier.
  Hello, Yehuda Katz.
最后更新: 2020/2/26 16:01:18