Feat: synthetic events wired up (ish)

This commit is contained in:
Jonathan Kelley committed 2021-03-04 18:12:24 -05:00
1 parent 808e6570d2
commit 3087813570
2 files changed
+315 -69

No files matched your search

+12 -17
View File
@@ -9,24 +9,19 @@
use dioxus::prelude::*;
fn main() {
let app = dioxus_webview::new(|ctx| {
async fn main() {
dioxus_webview::launch(|ctx| {
let (count, set_count) = use_state(ctx, || 0);
html! {
<div>
<h1> "Dioxus Desktop Demo" </h1>
<p> "Count is {count}"</p>
<p> "Count is {count}"</p>
<p> "Data is {data}"</p>
<button onclick=|_| set_count(count + 1) >
ctx.render(rsx! {
div {
h1 { "Dioxus Desktop Demo" }
p { "Count is {count}" }
button {
"Click to increment"
</button>
</div>
}
});
let f = 10_i32;
println!("hello {}", f);
app.launch(());
onclick: |_| set_count(count + 1)
}
}
})
}).await;
}