Index of an array element in Mustache.js

前端 未结 6 961
后悔当初
后悔当初 2020-12-06 01:31

This is what I\'d like to do in Mustache.js but not seeing how with the documentation.

var view = {items:[\'Mercury\',\'Venus\',\'Earth\',\'Mars\']};
var tem         


        
6条回答
  •  不知归路
    2020-12-06 01:59

    If you can use handlebars.js, then you can use the partial mentioned in this gist: https://gist.github.com/1048968

    Ref: In Mustache, How to get the index of the current Section

提交回复
热议问题