Fix additional attributes for js renderers (#3625)

This commit is contained in:
Evan Almloff authored and GitHub committed 2025-01-31 14:31:31 -08:00
1 parent 67515ce812
commit 2d188452ae
10 files changed
+125 -1

No files matched your search

@@ -41,6 +41,7 @@ fn app() -> Element {
Errors {}
}
OnMounted {}
DocumentElements {}
}
}
@@ -117,3 +118,19 @@ pub fn ThrowsError() -> Element {
"success"
}
}
/// This component tests the document::* elements pre-rendered on the server
#[component]
fn DocumentElements() -> Element {
rsx! {
document::Meta { id: "meta-head", name: "testing", data: "dioxus-meta-element" }
document::Link {
id: "link-head",
rel: "stylesheet",
href: "https://fonts.googleapis.com/css?family=Roboto+Mono"
}
document::Stylesheet { id: "stylesheet-head", href: "https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic" }
document::Script { id: "script-head", async: true, "console.log('hello world');" }
document::Style { id: "style-head", "body {{ font-family: 'Roboto'; }}" }
}
}