Enum leptos_dom::Attribute
source · pub enum Attribute {
String(String),
Fn(Rc<dyn Fn() -> Attribute>),
Option(Option<String>),
Bool(bool),
}
Expand description
Represents the different possible values an attribute node could have.
This mostly exists for the view
macro’s use. You usually won’t need to interact with it directly.
Variants§
String(String)
A plain string value.
Fn(Rc<dyn Fn() -> Attribute>)
A (presumably reactive) function, which will be run inside an effect to do targeted updates to the attribute.
Option(Option<String>)
An optional string value, which sets the attribute to the value if Some
and removes the attribute if None
.
Bool(bool)
A boolean attribute, which sets the attribute if true
and removes the attribute if false
.