Replies: 2 comments 2 replies
-
You could write something like the following. #1463 (comment) component {
class: "w-3 h-3 shrink-0",
class: if !is_open_1() { "rotate-180" },
/* and others */
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
Figured out another way: class: format_args!("w-3 h-3 shrink-0 {}", if is_open_1() { "" } else { "rotate-180" }), |
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.
-
I am currently using if-else logic inside a "class" attribute like this:
Is there a way to shorten it like this?
Beta Was this translation helpful? Give feedback.
All reactions