From 12fc86492d5343f63e41b3dc8b0fd8e7210fcdcd Mon Sep 17 00:00:00 2001 From: traxys Date: Sun, 28 May 2023 19:45:32 +0200 Subject: [PATCH] app: Render to main to add scripts to the entire application --- app/index.html | 5 ++++- app/src/main.rs | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/index.html b/app/index.html index a5b92f3..b8aa8c3 100644 --- a/app/index.html +++ b/app/index.html @@ -6,5 +6,8 @@ - + +
+ + diff --git a/app/src/main.rs b/app/src/main.rs index b3f159a..20617a7 100644 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -21,9 +21,7 @@ enum Route { fn App() -> Html { html! { -
- render={switch} /> -
+ render={switch} />
} } @@ -151,5 +149,13 @@ fn Login() -> Html { fn main() { console_log::init_with_level(Level::Debug).unwrap(); - yew::Renderer::::new().render(); + yew::Renderer::::with_root( + gloo_utils::document() + .body() + .expect("no body") + .get_elements_by_tag_name("main") + .item(0) + .expect("no main"), + ) + .render(); }