我有以下代码:
<template is="dom-repeat" items="{{todos}}" sort="sortComparator">
<div class="row">
<paper-icon-button icon="arrow-forward"></paper-icon-button>
<span>{{item.name}}</span>
<span class="btn-set">
<paper-icon-button icon="delete" on-tap="deleteTodo">delete</paper-icon-button>
<paper-icon-button icon="star" on-tap="toggleFavorite">star</paper-icon-button>
<span>
</div>
</template>
如果icon="star"
为真,我想向item.isFav
添加黄色。但我无法找到办法。任何建议,如何做。
答案 0 :(得分:1)
为按钮提供ID
this.$.myButton.style.color = 'yellow'
通过使用id,您可以立即为其设置样式
{{1}}