Counter for handlebars #each

后端 未结 8 947
小鲜肉
小鲜肉 2021-02-04 02:29

In Handlebars, say i have a collection of names how can i do

{{#each names}}
{{position}}
{{name}}
{{/each}}

where {{position}} is

8条回答
  •  执念已碎
    2021-02-04 02:58

    you can get value just from index inside the list.

    {{#each list}}
        @index
    {{/each}}
    

提交回复
热议问题