如何在 Polymer 绑定到字典中使用 dom-repeat
How do I use dom-repeat in Polymer binding to a dictionary
我正在尝试绑定到下面是字典的数据
<template is="dom-repeat" items="{{data}}">
</template>
我在这里发现了一个类似的问题Polymer: How to loop and render HTML to screen
<template repeat="{{customer, i in customers}}">
<div>{{i}}, {{customer.name}}</div>
</template>
但我不确定这是否适用于 Polymer 1.0,并且在文档中找不到任何内容。
如何在 1.0 中执行此操作?
干杯
第一个示例中的内容对于 Polymer 1.0 是正确的。 Here 是模板重复(dom-重复)的文档。
<template is="dom-repeat" items="{{data}}">
<div>
<span>{{index}}</span> <span>{{item}}</span>
</div>
</template>
我正在尝试绑定到下面是字典的数据
<template is="dom-repeat" items="{{data}}">
</template>
我在这里发现了一个类似的问题Polymer: How to loop and render HTML to screen
<template repeat="{{customer, i in customers}}">
<div>{{i}}, {{customer.name}}</div>
</template>
但我不确定这是否适用于 Polymer 1.0,并且在文档中找不到任何内容。
如何在 1.0 中执行此操作?
干杯
第一个示例中的内容对于 Polymer 1.0 是正确的。 Here 是模板重复(dom-重复)的文档。
<template is="dom-repeat" items="{{data}}">
<div>
<span>{{index}}</span> <span>{{item}}</span>
</div>
</template>