Polymer 当数组子属性更改时是否已计算绑定激发?

Polymer 当数组子属性更改时是否已计算绑定激发?,polymer,polymer-1.0,Polymer,Polymer 1.0,聚合物1。* 我正在尝试使用数组优化计算绑定的行为。我有FOO,但它经常向我开火 我将其优化为uploadState.value: <template is="dom-repeat" initial-count="1" index-as="index" items="{{uploadState}}"> <div hidden$="[[getState(uploadState.value)]]">FOO</div> 但它一

聚合物1。*

我正在尝试使用数组优化计算绑定的行为。我有FOO,但它经常向我开火

我将其优化为
uploadState.value

  <template is="dom-repeat"
    initial-count="1"
    index-as="index"
    items="{{uploadState}}">

    <div hidden$="[[getState(uploadState.value)]]">FOO</div>
但它一点也不着火。当
属性更改时,如何使其在计算绑定中激发


另外,如何使用
this.get()
在值发生更改时获取该值?我在计算绑定中尝试了
var upload=this.get(['uploadState.value',0])
,但它只是显示未定义(当它使用。*时)

使用绑定
uploadState.value的问题在于它不存在。您正在创建一个
uploadState
数组,其中包含一个属性为
value
的成员,该属性看起来更像
uploadState.*.value
,但您并不想在所有值更改时都进行更改,只需一个问题,这样您就可以利用
dom repeat
绑定,这样您的代码就会像这样出现:

<template is="dom-repeat"
  initial-count="1"
  index-as="index"
  items="{{uploadState}}">
    <div hidden$="[[item.value]]">FOO</div>
</template>

使用binding
uploadState.value的问题在于它不存在。您正在创建一个
uploadState
数组,其中包含一个属性为
value
的成员,该属性看起来更像
uploadState.*.value
,但您并不想在所有值更改时都进行更改,只需一个问题,这样您就可以利用
dom repeat
绑定,这样您的代码就会像这样出现:

<template is="dom-repeat"
  initial-count="1"
  index-as="index"
  items="{{uploadState}}">
    <div hidden$="[[item.value]]">FOO</div>
</template>
<template is="dom-repeat"
  initial-count="1"
  index-as="index"
  items="{{uploadStates}}"
  as="uploadState">
    <div hidden$="[[uploadState.value]]">FOO</div>
</template>