mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
7e54764652
Not sure if my assumption is correct but it seemed this was the intention of the popup fn.
28 lines
577 B
Rust
28 lines
577 B
Rust
use dioxus::prelude::*;
|
|
use dioxus_desktop::{use_window, WindowBuilder};
|
|
|
|
fn main() {
|
|
dioxus_desktop::launch(app);
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
let window = 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!" }
|
|
})
|
|
}
|