Repository navigation
Replies: 4 comments 2 replies
|
You should be able to do this with an element that has But templates should only have one root element. Alpine might be able to support it, but it does make all the loop logic more difficult. |
|
You can nest |
|
Alpine still needs one root inside an <table x-data>
<template x-for="index in $store.global_data.length" :key="index">
<tbody>
<tr :id="'table-column-header-' + index">
<th scope="row" x-text="'Header ' + index"></th>
</tr>
<tr :id="'table-column-body-' + index">
<td x-text="'Details ' + index"></td>
</tr>
</tbody>
</template>
</table>Remove the original outer I put a complete expandable example here, with stable keys, keyboard buttons and editable notes. With Alpine 3.17.4, its browser checks cover repeated reordering, adding/removing records and adding again after the list is empty, while keeping the heading/detail pairs and edited content together. It uses Alpine to control expansion; your external |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I need to do something like this :
Is it possible for a template to have 2 children (tr tags) ?
All reactions