<section>
<core-menu selected="0" on-core-select="{{selectAction}}">
<core-item icon="settings" label="Settings"></core-item>
<core-item icon="dialog" label="Dialog"></core-item>
<core-item icon="search" label="Search"></core-item>
</core-menu>
</section>
void selectAction (e, detail)
{
if ( e.target.isSelected)
{
var selectedItem = detail.item;
print ( selectedItem );
}
}
即使只是尝试使用代码运行应用程序而不尝试选择,也会给出以下结果
Exception: Class 'CoreMenu' has no instance getter 'isSelected'.
NoSuchMethodError: method not found: 'isSelected'
Receiver: Instance of 'CoreMenu'
这里有错误还是代码错误