【问题标题】:mustache how to get element in array by indexmustache 如何通过索引获取数组中的元素
【发布时间】:2015-05-05 07:58:28
【问题描述】:

如何在 mustache 中通过数组获取元素值 对象

    Map(name -> zzzzzzzzzzzzzzz, 
 pageUrl -> /novokuzneck/zum-zum-dvernye-i-okonnye-resheniya/contacts, 
 organiztionUrl -> http://192.168.0.106/c/1245678/, 
 phones -> List(
    Map(phone -> +7333333333, comment -> adsdas), 
    Map(phone -> 81234567, comment -> test), 
    Map(phone -> 822222222, comment -> test2)), 

)

如何获得

<p>{{phones.0.phone}}</p>

【问题讨论】:

    标签: mustache scalate


    【解决方案1】:

    试试

    {{#phones}}
          <p>{{index}} {{phone}}<p>
    {{/phones}}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 2022-06-27
      • 2012-02-14
      • 2013-12-03
      • 2015-04-05
      • 2011-03-02
      • 2021-10-21
      相关资源
      最近更新 更多