If statement rsx

This commit is contained in:
2026-01-25 20:00:21 +01:00
parent ecc1172737
commit 993a790da7
2 changed files with 61 additions and 17 deletions
+7 -3
View File
@@ -83,10 +83,14 @@ fn app(cx: &Arc<Context>) -> View {
// }
rsx! {
my_component (ctx, view) {
let area = ctx.allocate(0, 0, 10, 10);
ctx.draw_view(area, view);
if %count (*count.get() > 0) {
my_component (ctx, view) {
let area = ctx.allocate(0, 1, 10, 10);
ctx.draw_view(area, view);
}
}
%count "{count}"
}
.view(cx.clone())
}