-
For example,. showing a message when it is set. if let Some(msg) = self.message {
node! {
<div>{text(msg)}</div>
}
} else {
// What to do here?
} |
Beta Was this translation helpful? Give feedback.
Answered by
ivanceras
Jan 26, 2024
Replies: 3 comments 5 replies
-
You can either go with: view_if(self.message.is_some(), {
node! {
<div>{text(self.message.unwrap())}</div>
}
} or if let Some(msg) = self.message {
node! {
<div>{text(msg)}</div>
}
} else {
<span></span>
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Magicloud
-
Is there a way to map an fn foo(mdl: &Mdl) -> Node<M> {
vec![ ] // would be empty
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
also appears to create up an empty node work. I'm not sure what the non-macro version would be. |
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
You can either go with:
or