mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
23 lines
544 B
Plaintext
23 lines
544 B
Plaintext
class {
|
|
onMount() {
|
|
this.events = [];
|
|
}
|
|
|
|
handleAttach(color, event, node){
|
|
this.events.push({
|
|
color: color,
|
|
event: event,
|
|
node: node
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
<ul>
|
|
<color-include>
|
|
<li.color if(input.color==="blue") on-attach('handleAttach', input.color)>blue</li>
|
|
<li.color else-if(input.color==="green") on-attach('handleAttach', input.color)>green</li>
|
|
<li.color else on-attach('handleAttach', input.color)>${input.color}</li>
|
|
</color-include>
|
|
</ul>
|