如何将值绑定到Aurelia中的TCustomAttribute



我试图实现以下结果:我有一组来自数组的值,我对这些值进行迭代以填充HTML表。此外,我还有一个图标,用户可以在上面浏览,可以看到来自数组的数据和来自翻译文件的翻译键。

我想将第二个参数绑定到TCustomAttribute,以便向用户显示他们编辑的另一个数据。

我如何在Aurelia实现这一点?

<template>
<table>
<thead>
<th><span>Id</span></th>
<th><span>Name</span></th>
<th><span>Description</span></th>
<th><span>Date</span></th>
</thead>
<tbody>
<tr repeat.for="item of data">
<td><span>${item.Id}</span></td>
<td><span>${item.Name}
<a data-toggle="popover" t="[data-content]pending_name ${data.Name}" data-trigger="hover">
<i class="fa fa-info-circle"></i>
</a>
</span></td>
<td><span>${item.Description}</span></td>
<td><span>${item.Date}</span></td>
</tr>
</tbody>
</table>
</template>

查看t-params属性,该属性允许您传入其他参数。官方指南中的更多信息http://aurelia.io/docs/plugins/i18n#using-插件

最新更新