【发布时间】:2015-12-21 10:44:45
【问题描述】:
我在这样的核心选择器中有一个纸质复选框元素列表
<core-selector id="moduleSelector" multi="true" valueattr="label" notap?="{{true}}" on-core-select="{{selectionSelect}}>
<template repeat="{{modules in moduleslist}}">
<core-label horizontal layout>
<paper-checkbox id="modulecheckbox" checked="{{modules.checked}}" label="{{modules.pname}}"
on-change={{checkboxHandler}} noink></paper-checkbox>
</core-label>
<br>
</template>
</core-selector>
我希望使用 this.$.moduleSelector.selected 获取所选纸张复选框标签的数组,但我只得到一些根据模块列表索引不准确的索引值。我需要获取标签名称。
如果我使用纸质物品而不是下面的复选框
<core-selector id="moduleSelector" valueattr="label" multi="true" notap?="{{false}}">
<template repeat="{{modules in moduleslist}}">
<paper-item label="{{modules}}"></paper-item>
</template>
</core-selector>
然后我可以使用 this.$.moduleSelector.selected 获取正确的数组值
任何帮助将不胜感激。
【问题讨论】: