iter(g312): 表格空状态补操作插槽

This commit is contained in:
HIsheR
2026-10-27 00:43:13 +08:00
parent 79bf7d6f60
commit c9665501aa
7 changed files with 32 additions and 7 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ export function dataTable<T extends { id: RowKey }>(props: DataTableProps<T>): H
if (busy()) return skeletonRows(); // 加载态优先:不看数据,避免闪出旧行
const sel = state().selection; // 读入依赖:选择变化即整表重绘(行数 = pageSize,代价可控)
const rows = visible().rows;
if (!rows.length) return [emptyRow(span(), keyword, () => table.dispatch({ type: 'setFilter', key: filterKey, value: '' }), props.emptyText)]; // 空状态:筛选词与内核筛选一起清
if (!rows.length) return [emptyRow(span(), keyword, () => table.dispatch({ type: 'setFilter', key: filterKey, value: '' }), props.emptyText, props.emptyAction)]; // 空状态:筛选词与内核筛选一起清;真没数据时给调用方的操作插槽
return rows.map((row, i) => {
const key = visible().keys[i];
const selected = sel.includes(key);