【问题标题】:How do I bind a value to a TCustomAttribute in Aurelia?如何将值绑定到 Aurelia 中的 TCustomAttribute?
【发布时间】:2020-07-09 05:35:51
【问题描述】:

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

【问题讨论】:

    标签: internationalization aurelia aurelia-templating


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-18
      相关资源
      最近更新 更多