Aurelia repeat.for access index of item

前端 未结 1 1001
北海茫月
北海茫月 2021-02-06 20:24

I have a simple repeat.for:

  • ${item}
  • Currently I\'m using: ${$parent.items.indexOf(item)

    相关标签:
    1条回答
    • 2021-02-06 21:01

      There is. Write this:

      <li repeat.for="item of items">${$index} - ${item}</li>
      
      0 讨论(0)
    提交回复
    热议问题