Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dsinni opened this issue Jul 30, 2019 · 3 comments
Open

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

dsinni opened this issue Jul 30, 2019 · 3 comments

Comments

@dsinni
Copy link
Contributor

dsinni commented Jul 30, 2019

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!

@ngokevin
Copy link
Collaborator

ngokevin commented Jul 30, 2019

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

@dsinni
Copy link
Contributor Author

dsinni commented Jul 31, 2019

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.

@ngokevin
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants