我想从Polymer元素内部触发/发送/发出自定义事件.例如,我想将像"已更改"的普通DOM事件转换为更像"todoupdated"的语义事件.
这是我的HTML:
<polymer-element name="todo-item" extends="li" attributes="item">
<template>
<style>
label.done {
color: gray;
text-decoration: line-through;
}
</style>
<label class="checkbox {{item.doneClass}}">
<input type="checkbox" checked="{{item.done}}">
{{item.text}}
</label>
</template>
<script type="application/dart" src="todo_item.dart"></script>
</polymer-element>
Run Code Online (Sandbox Code Playgroud)
我希望复选框上的更改事件从自定义元素中冒出来,因为它更有用...... :)