Closed sideshot closed 10 months ago
I always like to creating a child component for each item in any loop -in my experience it usually results in simpler code rather than trying to do too much in the containing component.
do you happen to have an example of how you would do that in a loop to create the child components, and then use the child comp .expanded feature?
You'll move most of the code to a child component which will create the disclosure for each item passed in then just have:
{#each filters as section}
<Section {section} />
{/each}
{smh}
Perfect! Thanks!
I'm running into a problem trying to put multiple disclosures on the same page.
For instance, I have multiple filter blocks. Adding them in a loop worked, but the 'store' value was unreachable. Can you recommend a solution?
I managed to create this to make it work.
demo data