awesome: arbitrary expressions excepted without braces
This commit is contained in:
1 parent
14961023f9
commit
4c85bcfdc8
40 files changed
+825
-767
No files matched your search
@@ -0,0 +1,31 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
dioxus::desktop::launch(app);
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let contents = use_state(&cx, || String::from("<script>alert(123)</script>"));
|
||||
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
"hello world!"
|
||||
|
||||
h1 {
|
||||
"{contents}"
|
||||
}
|
||||
h3 {
|
||||
[contents.as_str()]
|
||||
}
|
||||
|
||||
input {
|
||||
value: "{contents}",
|
||||
oninput: move |e| {
|
||||
contents.set(e.value.clone());
|
||||
eprintln!("asd");
|
||||
},
|
||||
"type": "text",
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user