Enum leptos_dom::Property

source ·
pub enum Property {
    Value(JsValue),
    Fn(Box<dyn Fn() -> JsValue>),
}
Expand description

Represents the different possible values an element property could have, allowing you to do fine-grained updates to single fields.

This mostly exists for the view macro’s use. You usually won’t need to interact with it directly.

Variants§

§

Value(JsValue)

A static JavaScript value.

§

Fn(Box<dyn Fn() -> JsValue>)

A (presumably reactive) function, which will be run inside an effect to toggle the class.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.