Clone in a terminal:
use kaja_web::prelude::*; #[component("main-component")] pub struct Main { message: Option<String>, } impl Component for Main { fn connected(&mut self, element: HtmlElement) { self.render(element); } } impl Main { fn render(&self, element: HtmlElement) { let content = html! {{ <div><counter-component count="1" /></div> <div><counter-component count="42" /></div> }}; element.set_inner_html(content.as_str()); } }

File history (2 commits)

6b30cee Johan Mattsson - johan.mattsson.m@gmail.com
Callback updated
Callback updated
674bd7b Johan Mattsson - johan.mattsson.m@gmail.com
Full example using web components
Full example using web components

Click counter example.

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112