Closed rohanrajpal closed 1 year ago
You could create a child component and use it in the {#each} block, that makes it easy for each one to have it's own disclosure instance. Here's an unstyled example:
https://svelte.dev/repl/3add15ebfc244604ba5c09d6bc65dac0?version=3.55.0
You might also remove the numbers from the content and use the index from the each block, so they are always consistent.
Neat trick! Thanks, this should work for me.
Thanks a ton for this beautiful library! I had one small doubt.
Say I have the list of options
How do I iterate over these and create a disclosure?
The following code doesn't work since one cant just iterate over an array of stores I guess (or maybe i'm not smart enough to figure out how)