可以在Polymer中动态创建绑定属性名称吗?
在Polymer中,我在可以在Polymer中动态创建绑定属性名称吗?,polymer,Polymer,在Polymer中,我在中创建了一些元素,如下所示: <template is="dom-repeat" items="{{myItems}}"> <app-route route="[[_route]]" pattern="/view-{{index}}/:data" data="{{_routeData}}" active="{{_routeActive}}"> </app-r
中创建了一些
元素,如下所示:
<template is="dom-repeat" items="{{myItems}}">
<app-route route="[[_route]]"
pattern="/view-{{index}}/:data"
data="{{_routeData}}"
active="{{_routeActive}}">
</app-route>
</template>
我想在数据
和活动
属性值中使用{{index}}
来创建动态绑定属性名,例如{{u route{{index}}data}
即在创建绑定名时评估{index}
。这意味着它们对于每条路线都是唯一的
在聚合物中有可能做到这一点吗?如果没有其他方法?据我所知,Polymer目前不支持您所描述的嵌套绑定。(对于单向绑定,您可以使用(例如,
data=“[[u getRouteData(index)]]”“
,但这不适用于您的情况,因为您需要输出属性。)