один:
<Grid data={dataPage} bind:filter bind:sort rowClass={row => selected?.includes(row.id) && 'selected'}>
<SelectColumn idList={filteredData.map(r=>r.id)} bind:selected/>
<Column label="№" selector="id"/>
<Column label="Employee" sort="name" let:row>
{row.gender === 'Male' ? '👨' : '👩'} {row.name}
</Column>
<Column label="Age" selector="age" sort/>
<Column label="Job" selector="occupation" sort filter/>
<Column label="Salary" selector="salary" sort="-salary" let:value>${value?.toLocaleString('en')}</Column>
<Column label="Country" selector="nationality" sort filter>
<span slot="before" let:value>{flags[value]}</span>
</Column>
<Column label="Actions" let:row>
<span on:click={()=>view(row)}>🔍</span>
<span on:click={()=>remove(row)}>🗑</span>
</Column>
<span slot="sort" let:dir>
{['⬆️️️','↕️','⬇️️'][dir+1]}
</span>
</Grid>
круто.
Обсуждают сегодня