You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
598 B
23 lines
598 B
<script> |
|
import { t } from '../../translations.svelte'; |
|
|
|
let { items, selected = $bindable(null), drag_start = item => console.log({dragging:item}) } = $props(); |
|
</script> |
|
<table> |
|
<thead> |
|
<tr> |
|
<th>{t('id')}</th> |
|
<th>{t('code')}</th> |
|
<th>{t('name')}</th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
{#each items as item} |
|
<tr onclick={ev => selected = item} ondragstart={e => drag_start(item)} draggable="true"> |
|
<td>{item.id}</td> |
|
<td>{item.code}</td> |
|
<td>{item.name}</td> |
|
</tr> |
|
{/each} |
|
</tbody> |
|
</table>
|
|
|