|
|
@ -188,12 +188,19 @@ If a *key* expression is provided — which must uniquely identify each list ite
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
You can freely use destructuring patterns in each blocks.
|
|
|
|
You can freely use the destructuring pattern in each blocks, the rest syntax being supported.
|
|
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
```sv
|
|
|
|
{#each items as { id, name, qty }, i (id)}
|
|
|
|
{#each items as {id, name, qty}, i (id)}
|
|
|
|
<li>{i + 1}: {name} x {qty}</li>
|
|
|
|
<li>{i + 1}: {name} x {qty}</li>
|
|
|
|
{/each}
|
|
|
|
{/each}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{#each objects as {id, ...rest}}
|
|
|
|
|
|
|
|
<li><span>{id}</span><MyComponent {...rest} /></li>
|
|
|
|
|
|
|
|
{/each}
|
|
|
|
|
|
|
|
{#each items as [id, ...rest]}
|
|
|
|
|
|
|
|
<li><span>{id}</span><MyComponent values={rest} /></li>
|
|
|
|
|
|
|
|
{/each}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
@ -1351,4 +1358,4 @@ The `<svelte:options>` element provides a place to specify per-component compile
|
|
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
```html
|
|
|
|
<svelte:options tag="my-custom-element"/>
|
|
|
|
<svelte:options tag="my-custom-element"/>
|
|
|
|
```
|
|
|
|
```
|
|
|
|