From b0a87e5d738a06f7034e3d10dd7f9b994fd53626 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 25 Feb 2021 21:42:44 -0500 Subject: [PATCH] Feat: update example --- packages/webview/Cargo.toml | 4 +- packages/webview/examples/demo.rs | 65 ++++++++++++++++--------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/packages/webview/Cargo.toml b/packages/webview/Cargo.toml index 215f3d340..52252e8b1 100644 --- a/packages/webview/Cargo.toml +++ b/packages/webview/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -web-view = { git = "https://github.com/Boscop/web-view" } -# web-view = "0.7.2" +# web-view = { git = "https://github.com/Boscop/web-view" } +web-view = "0.7.3" dioxus-core = { path = "../core" } anyhow = "1.0.38" argh = "0.1.4" diff --git a/packages/webview/examples/demo.rs b/packages/webview/examples/demo.rs index 92cf8ae13..078e8c5c3 100644 --- a/packages/webview/examples/demo.rs +++ b/packages/webview/examples/demo.rs @@ -1,9 +1,8 @@ //! 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::prelude::*; -fn main(){ +fn main() { dioxus_webview::launch( // Customize the webview |builder| { @@ -16,37 +15,39 @@ fn main(){ // Props (), // Draw the root component - |ctx, _props| { - ctx.view(html! { -
-
-
-
- // Title -
"Jon's awesome site!!11"
- - // Subtext / description -
"He worked so hard on it :)"
- -
- // Main number -
- "1337" -
-
- - // Try another - + Example, + ) + .expect("Webview finished"); +} + +static Example: FC<()> = |ctx, _props| { + ctx.view(html! { +
+
+
+
+ // Title +
"Jon's awesome site!!11"
+ + // Subtext / description +
"He worked so hard on it :)"
+ +
+ // Main number +
+ "1337"
+ + // Try another +
- }) - }, - ).expect("Webview finished"); -} - +
+
+ }) +};