11ty / webc

Single File Web Components
MIT License
1.3k stars 36 forks source link

more explorative tests for webc:for #161

Closed sombriks closed 1 year ago

sombriks commented 1 year ago

i was trying to build that scenario for the issue i was facing, however i am not sure anymore if it's a issue at all.

i did this testcase, please merge it if it worth anything.

i'll try to apply what i learned doing it on my faulty code, see if the issue was, once again, between the keyboard and the chair ;-)

zachleat commented 1 year ago

Just so I understand, this is testing aliasing the loop item as a separate variable name?

lsilveira-boku commented 1 year ago

Just so I understand, this is testing aliasing the loop item as a separate variable name?

yes, and nesting loops too.

it works perfectly, the issue i saw must be related to my use on my blog, not to webc itself.

on a smaller note, i got access to the variable created by for inside one of the components, however they are inside the default slot, so i think this is expected.

it was a very clean way to understand my problem, an the test suite is quite nice to read and understand.