我有一个multi-selection-enabled iron-list,我的问题不是在单击时选择/取消选择项,而是在每次单击时将[[children]]的单击元素添加到{{selectedChildren}}中。
<iron-list items="[[children]]" selected-items="{{selectedChildren}}" selection-enabled multi-selection>
<template>
<div class$="[[iconForItem(selected, item)]]">
<iron-image class="avatar" sizing="contain" src="[[item.pic]]"></iron-image>
<div class="pad">
<div class="primary" th:inline="none">[[item.name]]</div>
<div class="secondary dim" th:inline="none">[[item.bdate]]</div>
<div><paper-textarea value="{{item.comment}}" on-tap="noFoc"></paper-textarea></div>
</div>
</div>
</template>
</iron-list>这里的问题可能是什么?
发布于 2017-08-09 05:54:02
问题是:
properties: {
selectedChildren: {
type: Array, // bad idea
value: [] // bad idea
}
}它应该是:
properties: {
selectedChildren: {
type: Object // This works
}
}https://stackoverflow.com/questions/45556260
复制相似问题