For loop for rectangle #5127
Unanswered
MohaBeacon
asked this question in
Q&A
Replies: 1 comment
-
yes, you can use for and props to create: component App inherits Window {
height: 300px;
width: 300px;
in property <[{id: int, name:string}]> boxs: [
{id:0, name: "A"},
{id:1, name: "B"},
{id:2, name: "C"},
];
VerticalLayout {
spacing: 10px;
for box in root.boxs: Rectangle {
height: 30px;
width: 100px;
background: #ddd;
Text{
text: box.name;
}
}
}
} |
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
-
just like iterating through text, is it possible to create shapes like number of rectangles with parameter / list of elements passed?
Beta Was this translation helpful? Give feedback.
All reactions