enterprise/enterprise-old/todomvc/components/mod.rs
2020-02-04 08:48:19 -06:00

24 lines
479 B
Rust

component! {
use enterprise::event::ClickEvent;
use enterprise::components::Button;
component Counter {
constructor() {
count: u32 = 0u32,
}
view {
<Button on:click={handleClick}>
Clicked {count} {if count == 1 { "time" } else { "times" }}
</Button>
}
fn handleClick(&mut self, _: ClickEvent) {
self.count += 1;
}
}
component Other {
}
}