SusTable

Лёгкий header + scrollable rows + pagination footer — тот же SusTableController, что у DataTable, без toolbar / typed-cell chrome.
Пакет
SusKit · Данные (коммерческий)
Свойства
| Имя | Тип | По умолчанию | |
|---|---|---|---|
Controller | Prop<SusTableController> | new() | v-model |
Слоты
Слотов нет.
События
Публичных событий нет.
Хуки стиля
Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:
sus-buttonsus-tablesus-table__action-btnsus-table__bodysus-table__cellsus-table__cell--actionssus-table__cell--align-centersus-table__cell--align-endsus-table__cell--descriptionsus-table__cell--ellipsissus-table__cell--numbersus-table__cell--progresssus-table__footersus-table__footer-actionssus-table__footer-btnsus-table__footer-infosus-table__headersus-table__header-cellsus-table__header-rowsus-table__header-titlesus-table__header-title--align-centersus-table__header-title--align-endsus-table__header-title--sortablesus-table__media--clipsus-table__media--roundedsus-table__rowsus-table__row--hoverablesus-table__row--selectedsus-table__row--stripedsus-table__rowssus-table__sort-btnsus-table__sort-btn--active
Использование
Настройте колонки и элементы на контроллере, затем присвойте его вью.
csharp
var ctrl = new SusTableController();
ctrl.SetColumns(new List<ColumnDef>
{
new() { Key = "name", Title = "Name", Sortable = true },
new() { Key = "role", Title = "Role", Sortable = true },
new() { Key = "lvl", Title = "Lvl", Sortable = true },
});
ctrl.SetItems(new List<object>
{
new Dictionary<string, object> { ["name"] = "Aria", ["role"] = "Tank", ["lvl"] = 12 },
new Dictionary<string, object> { ["name"] = "Borin", ["role"] = "DPS", ["lvl"] = 9 },
new Dictionary<string, object> { ["name"] = "Cira", ["role"] = "Heal", ["lvl"] = 14 },
});
ctrl.SetItemsPerPage(5);
var table = new SusTable();
table.Controller.Value = ctrl;xml
<template>
<sus:SusTable :Controller="TableCtrl.Value" />
</template>
<script>
public Prop<SusTableController> TableCtrl = new(new());
// Populate TableCtrl columns/items in code (see above).
</script>| Prop | Роль |
|---|---|
Controller | SusTableController — колонки, элементы, сортировка, страница |
Заметки
- Проще, чем
SusDataTable: нет слота toolbar, нет chrome для kind-пресетов, ячейки рендерятся как текст. - Футер пагинации появляется, когда
TotalPages > 1. - Для типизированных ячеек / глобального поиска / колонки выбора — используйте SusDataTable.