supermedium/superframe

[state] Allow access to loop index in bind-for/bind-item

Opened this issue · 3 comments

It would be great if bind-for and bind-item allowed access to the loop index so that it could be used for things such as numbering items as they are displayed (not necessarily as they are stored by id), or used to calculate positioning without needing to rely on something like the layout component, just to give a couple of examples.

If this is already possible, please forgive the issue, but I didn't anything obvious in the code or docs.

Thanks and keep up the great work!

Yeah, that's a good idea. Having a component read its sibling index is a workaround.

Thanks for the reply, @ngokevin.

Having a component read its sibling index is a workaround.

Sorry, would you mind elaborating just a bit on that? I'm not sure I'm following.

Appreciate your time.

use JS to get the index of the element relative to parent