Collections of useful macros for wasm

Examples

```rust use wasmmacro::*; //locationassign onclick:move||{ locationassign!("/demo");// nevigate to /demo } //locationherf onclick:move||{ let herf = locationherf!(); consolelog!(herf); //get current location herf } //locationreload onclick:move||{ locationreload!(); //reload current location } //queryselector onclick:move||{ let maindiv = documentqueryselector!(".main"); match maindiv{ Some(div) => { div.appendchild(&documentcreateelement!("div").clonenode().unwrap()); }, None => {}, } } //queryselectorall onclick:move||{ let maindiv = documentqueryselectorall!(".main"); match maindiv.get(0){ //frist of NodeList Some(div) => { div.appendchild(&documentcreateelement!("div").clonenode().unwrap()); }, None => {}, } // get innerhtml onclick:move||{ consolelog!(documentinnerhtml!(".main")); } //set innerhtml onclick:move||{ documentsetinner_html!(".main","

hello

"); }

//console.log() onclick:move||{ consolelog!(documentinnerhtml!(".main")); }

//documentbaseuri!() return baseuri use wasmmacro::; onclick:move|_|{ console_log!(document_base_uri!()); } use wasm_macro::; onclick:move||{ consolelog!(elementgetattribute!(".main","class"));//"main" } ```

demo

Cargo.toml ```toml [package] name = "demo_wasm" version = "0.1.0" edition = "2021"

[dependencies] wasmmacro="0.1.8" web-sys = { version = "0.3.57", features = [ 'Document', 'Element', 'HtmlElement', 'Node', 'Window', "WindowClient", ] } dioxus = { version = "0.2.4", features = ["web", "router"] } consoleerrorpanichook = "0.1" tracing-wasm = "0.2" tracing = "0.1" main.rs rust fn main(){ run::launch(); } pub mod run{ use dioxus::prelude::; pub fn launch() { dioxus::web::launch(app); } pub fn app(cx: Scope) -> Element { use wasm_macro::; consoleerrorpanichook::setonce(); tracingwasm::setasglobaldefault();

    cx.render(rsx! {
        div{
            onclick:move|_|{
                // location_assign!("/demo");
                // info!("{}",location_herf!());
                // location_reload!();
                let main_div = document_query_selector_all!(".main");

                match main_div.get(0){ //frist of NodeList
                    Some(div) => {
                        div.append_child(&document_create_element!("div").clone_node().unwrap()).unwrap();
                    },
                    None => {},
                }
                console_log!(document_inner_html!(".main"));
                console_log!(document_base_uri!());
                document_set_inner_html!(".main","<h1>hello</h1>")
            },
            class:"main",
            "test"
            }
    })
}

}
```