如何在Aurelia使用带有多个属性的computedFrom

时间:2016-06-17 10:43:00

标签: aurelia aurelia-binding

我有以下代码:

@computedFrom(['id', 'isDiscontinued'])
get disableAdd(){
    return this.id === '0' || this.isDiscontinued;
}

这会抛出以下错误:aurelia-binding.js:2580 Uncaught TypeError:this.input.charCodeAt不是函数

然而这有效:

@computedFrom('id')
get disableAdd(){
    return this.id === '0' || this.isDiscontinued;
}

但我需要两个computedFrom字段,我做错了什么?

1 个答案:

答案 0 :(得分:5)

<style >
  :host{
    --iron-overlay-backdrop-background-color: #fff;
  }
</style>

不需要@computedFrom('id', 'isDiscontinued') get disableAdd(){ return this.id === '0' || this.isDiscontinued; }