pub struct VDomElement {
    pub name: &'static str,
    pub attr: HashMap<&'static str, String>,
    pub children: Vec<VDomNode>,
    pub dom_ref: Option<&'static str>,
    pub dom_apply: Option<Rc<dyn Fn(&NodeRefs)>>,
    pub on_click: Option<Rc<dyn Fn()>>,
    pub on_input: Option<Rc<dyn Fn(String)>>,
    pub on_mouse_enter: Option<Rc<dyn Fn()>>,
    pub on_mouse_leave: Option<Rc<dyn Fn()>>,
    pub on_key_down: Option<Rc<dyn Fn(KeyDownEvent) -> bool>>,
    pub css: Option<Css>,
}
Expand description

Virtual DOM node that represents a DOM element, a basic building block.

Usually returned from a render function:

use vertigo::{VDomElement, html};

fn my_render() -> VDomElement {
    html! {
        <div>
            <p>"Hello!"</p>
        </div>
    }
}

Fields

name: &'static strattr: HashMap<&'static str, String>children: Vec<VDomNode>dom_ref: Option<&'static str>dom_apply: Option<Rc<dyn Fn(&NodeRefs)>>on_click: Option<Rc<dyn Fn()>>on_input: Option<Rc<dyn Fn(String)>>on_mouse_enter: Option<Rc<dyn Fn()>>on_mouse_leave: Option<Rc<dyn Fn()>>on_key_down: Option<Rc<dyn Fn(KeyDownEvent) -> bool>>css: Option<Css>

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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.