2023-11-08 00:24:07 +00:00
|
|
|
use dioxus::{core::CapturedError, prelude::*};
|
2022-03-08 19:15:18 +00:00
|
|
|
|
|
|
|
fn main() {
|
2024-01-16 01:04:39 +00:00
|
|
|
dioxus_desktop::launch(app);
|
2022-03-08 19:15:18 +00:00
|
|
|
}
|
|
|
|
|
2024-01-15 21:06:05 +00:00
|
|
|
fn app() -> Element {
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2023-11-08 00:24:07 +00:00
|
|
|
ErrorBoundary {
|
|
|
|
handle_error: |error: CapturedError| rsx! {"Found error {error}"},
|
2024-01-14 05:12:21 +00:00
|
|
|
DemoC { x: 1 }
|
2022-03-08 19:15:18 +00:00
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-11-16 09:13:39 +00:00
|
|
|
}
|
|
|
|
|
2023-09-15 14:13:36 +00:00
|
|
|
#[component]
|
2024-01-14 04:51:37 +00:00
|
|
|
fn DemoC(x: i32) -> Element {
|
2023-11-08 00:24:07 +00:00
|
|
|
let result = Err("Error");
|
|
|
|
|
|
|
|
result.throw()?;
|
|
|
|
|
2024-01-11 20:11:27 +00:00
|
|
|
render! {
|
|
|
|
h1 { "{x}" }
|
|
|
|
}
|
2022-03-08 19:15:18 +00:00
|
|
|
}
|