mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
Chore: fix up html macro
This commit is contained in:
parent
3475adaaa6
commit
ae1b8bbede
2 changed files with 5 additions and 21 deletions
|
@ -1,9 +1,10 @@
|
|||
[package]
|
||||
name = "html-macro"
|
||||
version = "0.1.9"
|
||||
description = "html macro"
|
||||
name = "dioxus-html-macro"
|
||||
version = "0.1.0"
|
||||
description = "HTML-compliant macro for creating Dioxus VNodes"
|
||||
authors = [
|
||||
"Jonathan Kelley",
|
||||
# Originally pulled from Percy - check it out!
|
||||
"Chinedu Francis Nwafili <frankie.nwafili@gmail.com>",
|
||||
]
|
||||
keywords = ["virtual", "dom", "wasm", "assembly", "webassembly"]
|
||||
|
|
|
@ -1,20 +1,3 @@
|
|||
# html-macro
|
||||
|
||||
```rust
|
||||
use html_macro::*;
|
||||
|
||||
fn main () {
|
||||
let component = html! { <div id='component'>Some component</div> };
|
||||
|
||||
let text_var = "You can interpolate text variables";
|
||||
|
||||
let html = html! {
|
||||
<div onclick=|_ev: web_sys::MouseEvent| {}>
|
||||
You can type text right into the elements
|
||||
{ component }
|
||||
{ text_var }
|
||||
</div>
|
||||
};
|
||||
println!("{}", node);
|
||||
}
|
||||
```
|
||||
Disclaimer: much of this macro's source comes from Percy - another vdom implementation for Rust.
|
||||
|
|
Loading…
Reference in a new issue