feat: wire up event delegator for webview

This commit is contained in:
Jonathan Kelley committed 2021-07-24 02:52:05 -04:00
1 parent 0a907b35c6
commit 7dfe89c958
21 files changed
+265 -272

No files matched your search

+3 -4
View File
@@ -5,10 +5,9 @@ fn main() {
use dioxus_elements::{GlobalAttributes, SvgAttributes};
__cx.element(
dioxus_elements::button,
__cx.bump()
.alloc([dioxus::events::on::onclick(__cx, move |_| {})]),
__cx.bump().alloc([]),
__cx.bump().alloc([]),
[dioxus::events::on::onclick(__cx, move |_| {})],
[],
[],
None,
)
});
+2 -1
View File
@@ -5,6 +5,7 @@
// use dioxus::prelude::*;
fn main() {
env_logger::init();
dioxus::desktop::launch(App, |cfg| cfg);
}
@@ -23,7 +24,7 @@ const App: FC<()> = |cx| {
let operator = use_state(cx, || None as Option<Operator>);
let display_value = use_state(cx, || "".to_string());
let clear_display = display_value.eq("0");
let clear_display = display_value == "0";
let clear_text = if clear_display { "C" } else { "AC" };
let input_digit = move |num: u8| display_value.get_mut().push_str(num.to_string().as_str());
+1
View File
@@ -20,6 +20,7 @@ use dioxus::prelude::*;
const STYLE: &str = include_str!("./assets/calculator.css");
fn main() {
env_logger::init();
dioxus::desktop::launch(App, |cfg| cfg.with_title("Calculator Demo"))
.expect("failed to launch dioxus app");
}
+1
View File
@@ -12,6 +12,7 @@
use dioxus::prelude::*;
fn main() {
env_logger::init();
dioxus::desktop::launch(App, |c| c);
}