МТ
{#each array as item, i}
<Item use:someFunc={array.length == i - 1} {someOtherProp}/>
{/each}
function someFunc(node, isLast) {
if(isLast) {
someNodes = querySelectorAll('родительский тег каждого Item')
// otherCode
}
}
?
Size: a a a
МТ
{#each array as item, i}
<Item use:someFunc={array.length == i - 1} {someOtherProp}/>
{/each}
function someFunc(node, isLast) {
if(isLast) {
someNodes = querySelectorAll('родительский тег каждого Item')
// otherCode
}
}
КС
КС
КС
МТ
МТ
КС
{#each array as item, i}
{#if array.length === i - 1}
<Item use:someFunc {someOtherProp}/>
{:else}
<Item {someOtherProp}/>
{/if}
{/each}
МТ
{#each array as item, i}
{#if array.length === i - 1}
<Item use:someFunc {someOtherProp}/>
{:else}
<Item {someOtherProp}/>
{/if}
{/each}
МТ
КС
A
МТ
МТ
КС
bind:node={nodes[i]}
КС
export let node;
main div bind:this={node}
МТ
export let node;
main div bind:this={node}
МТ
КС
КС
КС