StarArawn / kayak_ui

Other
469 stars 50 forks source link

Dynamically rendering widgets inside the rsx! block ? #270

Closed ethereumdegen closed 1 year ago

ethereumdegen commented 1 year ago

In react and vue, I am able to perform a 'for' loop on a variable which will render a component for each iteration of the loop.

Is that possible to achieve in Kayak UI? I need to do this to build a data-driven menu (menu elements based on a vec) but i do not see documentation.

ethereumdegen commented 1 year ago

Oh i figured it out !!

you can do

{for n in 1..2 { constructor! { --WIDGET-- }}}

I think this should be in the documentation! More info about using the {{ }} stuff