Expose static repeater context for row index

This commit is contained in:
Andrew Kingston 2021-11-30 08:47:21 +00:00
parent f1b715e844
commit d2ce037297
2 changed files with 26 additions and 5 deletions

View File

@ -501,9 +501,20 @@
"defaultValue": "M"
}
],
"context": {
"context": [
{
"type": "schema"
},
{
"type": "static",
"values": [
{
"label": "Row Index",
"key": "index"
}
]
}
]
},
"stackedlist": {
"deprecated": true,
@ -3150,6 +3161,16 @@
}
]
},
{
"type": "static",
"suffix": "repeater",
"values": [
{
"label": "Row Index",
"key": "index"
}
]
},
{
"type": "schema",
"suffix": "repeater"

View File

@ -21,8 +21,8 @@
{#if $component.empty}
<Placeholder />
{:else if rows.length > 0}
{#each rows as row}
<Provider data={row}>
{#each rows as row, index}
<Provider data={{ ...row, index }}>
<slot />
</Provider>
{/each}