mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
27 lines
544 B
Rust
27 lines
544 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus_desktop::launch(app);
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
let window = dioxus_desktop::use_window(cx);
|
|
|
|
cx.render(rsx! {
|
|
div {
|
|
button {
|
|
onclick: move |_| {
|
|
let dom = VirtualDom::new(popup);
|
|
window.new_window(dom, Default::default());
|
|
},
|
|
"New Window"
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
fn popup(cx: Scope) -> Element {
|
|
cx.render(rsx! {
|
|
div { "This is a popup!" }
|
|
})
|
|
}
|