Aurelia repeat.for项目的访问索引 [英] Aurelia repeat.for access index of item

查看:114
本文介绍了Aurelia repeat.for项目的访问索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的重复.

<li repeat.for="item of items">${item}</li>

当前我正在使用:${$parent.items.indexOf(item)}. 有没有简写形式,例如{{$ index}}的斜角符号?

Currently I'm using: ${$parent.items.indexOf(item)}. Is there a shorthand, something like {{$index}} in angular?

推荐答案

有.写下:

<li repeat.for="item of items">${$index} - ${item}</li>

这篇关于Aurelia repeat.for项目的访问索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆