Replies: 1 comment
-
|
https://docs.rs/dioxus/latest/dioxus/prelude/macro.rsx.html#raw-expressions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1、 I have the following code snippet.
fn testfn(){
let mut cur_id = use_signal(|| 0 as u64);
let data = svc::get_data() ;
rsx! {
table {
for user in data.as_ref().unwrap().records.iter() {
tr{
td{
a {class: "hover-link",href: "",onclick: move |_| {
cur_id.set(user.id.as_ref().unwrap().u64());
},"删除"}
}
}
}
}
}
}
If I add: cur_id.set(user.id.as_ref().unwrap().u64());, it gives the error: "borrowed value does not live long enough". How can I implement Rust statements inside the RSX macro?
2、 Will future versions support Rust statements inside the RSX macro?
Beta Was this translation helpful? Give feedback.
All reactions