mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
23 lines
533 B
Plaintext
23 lines
533 B
Plaintext
class {
|
|
onInput() {
|
|
this.state = {
|
|
clickCount: 0
|
|
};
|
|
}
|
|
|
|
handleButtonClick() {
|
|
this.state.clickCount++;
|
|
}
|
|
}
|
|
|
|
div
|
|
h1 -- Hello ${input.name}!
|
|
div.colors
|
|
ul if(input.colors.length)
|
|
for(color in input.colors)
|
|
li.color style="background-color: ${color}"
|
|
-- ${color}
|
|
div else
|
|
-- No colors!
|
|
button type="button" onClick('handleButtonClick')
|
|
-- You clicked the button ${state.clickCount} time(s) |