温馨提示:本文翻译自stackoverflow.com,查看原文请点击:internationalization - How do I bind a value to a TCustomAttribute in Aurelia?
aurelia aurelia-templating internationalization

internationalization - 如何将值绑定到Aurelia中的TCustomAttribute?

发布于 2020-06-15 09:15:44

我正在尝试实现以下结果:我有一组值,这些值来自要进行迭代以填充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>

查看更多

提问者
Alex Talmazan
被浏览
10
zewa666 2020-03-29 16:04

看一下t-params属性,它允许您传递其他参数。有关更多信息,请参阅官方指南http://aurelia.io/docs/plugins/i18n#using-the-plugin