yew-vdom-gen

Crates.ioyew-vdom-gen
lib.rsyew-vdom-gen
version0.1.0
sourcesrc
created_at2021-12-12 08:41:39.891822
updated_at2021-12-12 08:41:39.891822
descriptionConstruct Yew’s Virtual DOM using ergonomic Rust idioms
homepage
repositoryhttps://github.com/hamza1311/yew-vdom-gen
max_upload_size
id496485
size114,194
Muhammad Hamza (hamza1311)

documentation

https://docs.rs/yew-vdom-gen

README

Yew VDOM Generator

Construct Yew’s Virtual DOM using ergonomic Rust idioms.

The API is based around functions and makes no use of macros, like yew::html! which allows it to provide great IDE support. IntelliSense is your friend when using this library.

Usage

use yew::prelude::*;
use yew_dsl::prelude::*;

struct Component1;
impl Component for Component1 {
    // ...
    fn view(&self) -> Html {
        h1("Heading ").into()
    }
}

struct Component2;
impl Component for Component2 {
    // ...
    fn view(&self) -> Html {
        div()
            .component::<Component2>(yew::props!(Component1::Properties {}))
            .child(h2("test2"))
            .listener(on_click(|_e| log!("test")))
            .into()
    }
}

Documentation

The API docs are hosted on docs.rs.

Commit count: 12

cargo fmt