mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 22:50:19 +00:00
20 lines
638 B
Rust
20 lines
638 B
Rust
//! Basic example that renders a simple domtree to the browser.
|
|
|
|
use dioxus_core::prelude::*;
|
|
use dioxus_web::*;
|
|
|
|
fn main() {
|
|
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(App));
|
|
}
|
|
|
|
static App: FC<()> = |ctx, _| {
|
|
ctx.view(html! {
|
|
<div>
|
|
<div class="flex items-center justify-center flex-col">
|
|
<div class="font-bold text-xl"> "Count is {}" </div>
|
|
<button onclick={move |_| log::info!("button1 clicked!")}> "increment" </button>
|
|
<button onclick={move |_| log::info!("button2 clicked!")}> "decrement" </button>
|
|
</div>
|
|
</div>
|
|
})
|
|
};
|