【发布时间】:2017-07-12 12:09:53
【问题描述】:
我注意到https://github.com/aurelia/i18n/issues/123 中已修复了一个类似问题。但在 't/i18n' 中,文字值是个问题。
但我遇到了“t.bind”的问题 我们有一个用例,我们需要构造表达式并将其绑定到 't/i18n'
例如:
<template>
<my-custom-element t.bind="messagekey" t-params.bind="{ param1: 10, param2: 10 }"></my-custom-element>
<my-custom-element t.bind="messagekey"></my-custom-element>
</template>
在视图模型中,我们如下构造消息键:
this.messagekey = "[title]content_key";
当您运行应用程序时,不会向自定义元素写入任何内容。
但是,我尝试使用带有文字值的 't';
<template>
<my-custom-element t="[title]content_key" t-params.bind="{ param1: 10, param2: 10 }"></my-custom-element>
<my-custom-element t="[title]content_key"></my-custom-element>
</template>
它成功了。
有人可以帮助我吗?
【问题讨论】:
标签: aurelia