iterate through JSON array with mustache

后端 未结 3 1605
挽巷
挽巷 2020-12-17 15:18

I am new to Mustache, please bear with me :)

I have an array in my JSON

\"prop\":{\"brands\":[\"nike\",\"adidas\",\"puma\"]}

if I h

3条回答
  •  再見小時候
    2020-12-17 15:52

    This works

    {{#json.props.brands}}
    

    {{.}}

    {{/json.props.brands}}

    {{.}} When looping over an array of strings, a . can be used to refer to the current item in the list.

提交回复
热议问题