ember-truth-helpers - 无法获得 eq 条件工作

ember-truth-helpers - not able to get eq condition work

在 select 组件上,我无法获得 selected 的最大值。 我的模型:selectedCreditCard.matchingTenure 是一个像这样的数组:["12", "24", "36", "48", "61"] 由此,我试图将最大值设置为默认值。

最大任期为 {{maxTenure}} //工作正常。得到 61,

比较 selected 没有得到任何值。有人帮我吗?

{{#rdc-form-select label="Instalment Duration" 
        labelPosition="left"
        options=selectedCreditCard.matchingTenure
        selected=(eq  getMatchingTenure selectedCreditCard.matchingTenure ) //not works
        searchEnabled=false
        renderInPlace=true
        class="installment-duration"
        onchange=(action 'selectATenure' ) as |data|}}
        {{data}}
    {{/rdc-form-select}}

您可以使用Ember.computed.max将最大值设置为组件外的默认选择,然后将其绑定并在组件内使用。

检查这个 twiddle