【问题标题】:Aurelia: Wizardry With Binding Behaviors with value converter?Aurelia:带有值转换器的绑定行为的巫术?
【发布时间】:2018-07-15 20:51:33
【问题描述】:

我一直在尝试 Ashley Grant 的帖子:https://bl.ocks.org/AshleyGrant/07e645e46f7cc945b4e43c4ec80c6424

并且想知道是否有人知道如何在使用“dynamicExpression”绑定行为后更进一步并应用值转换器。像这样的东西: <input type="text" value.bind="model & dynamicExpression:field.expression | formatNumber:'$###,###.00'" />

谢谢,

【问题讨论】:

    标签: binding aurelia behavior


    【解决方案1】:

    http://aurelia.io/docs/binding/binding-behaviors#introduction 此处的文档指出,值转换器仅观察传递的值,但行为可以完全访问绑定上下文。

    我想如果您将 formatNumber 重写为一种行为 - 您可以将它们链接起来。

    【讨论】:

      猜你喜欢
      • 2016-12-18
      • 2017-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多