polish: clean up the web module
This commit is contained in:
1 parent
1464d2e0a7
commit
823adc0834
15 files changed
+144
-50
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//! An example where the dioxus vdom is running in a native thread, interacting with webview
|
||||
//! Content is passed from the native thread into the webview
|
||||
use dioxus_core as dioxus;
|
||||
use dioxus_core::prelude::*;
|
||||
fn main() {
|
||||
dioxus_desktop::launch(
|
||||
|builder| {
|
||||
builder
|
||||
.title("Test Dioxus App")
|
||||
.size(320, 480)
|
||||
.resizable(false)
|
||||
.debug(true)
|
||||
},
|
||||
(),
|
||||
App,
|
||||
)
|
||||
.expect("Webview finished");
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
let hifives = use_model(&cx, || 0);
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
h1 { "Hi-fives collected: {hifives}" }
|
||||
button { "Hi five me!", onclick: move |_| *hifives.get_mut() += 1 }
|
||||
}
|
||||
})
|
||||
};
|
||||
Reference in new issue
Block a user