1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
--- import Show from './Show.astro'; interface Props<T> { each: Iterable<T>; } const { each } = Astro.props; --- { (async function* () { for await (const value of each) { let html = await Astro.slots.render('default', [value]); yield <Fragment set:html={html} />; yield '\n'; } })() } <Show when={!each.length}> <slot name="fallback" /> </Show>