fix href on stylesheet

This commit is contained in:
Jonathan Kelley committed 2024-10-28 17:55:56 -07:00
1 parent 42f6b91390
commit 04dbb7939c
1 file changed
+3 -4
+3 -4
View File
@@ -5,12 +5,12 @@ use super::*;
/// ///
/// ///
/// # Example /// # Example
/// ```rust, no_run /// ```rust
/// # use dioxus::prelude::*; /// # use dioxus::prelude::*;
/// fn RedBackground() -> Element { /// fn RedBackground() -> Element {
/// rsx! { /// rsx! {
/// document::Stylesheet { /// document::Stylesheet {
/// src: asset!("/assets/style.css") /// href: asset!("/assets/style.css")
/// } /// }
/// } /// }
/// } /// }
@@ -22,9 +22,8 @@ use super::*;
/// ///
/// </div> /// </div>
#[component] #[component]
pub fn Stylesheet(props: LinkProps, src: Option<String>) -> Element { pub fn Stylesheet(props: LinkProps) -> Element {
super::Link(LinkProps { super::Link(LinkProps {
href: src.or_else(|| props.href.clone()),
rel: Some("stylesheet".into()), rel: Some("stylesheet".into()),
r#type: Some("text/css".into()), r#type: Some("text/css".into()),
..props ..props