iter(g259): 数据表格暴露每页条数候选

This commit is contained in:
HIsheR
2026-10-26 22:21:54 +08:00
parent ee39b6088a
commit 11a22f93c1
5 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,6 @@ export function dataTable<T extends { id: RowKey }>(props: DataTableProps<T>): H
const selectedCount = computed(() => state().selection.length);
// 加载态读取器:布尔直接读,信号则保持响应性(供 renderList 依赖收集)
const busy = (): boolean => (typeof props.loading === 'function' ? props.loading() : props.loading === true);
// —— 受控页码桥接:外部信号 ↔ 内核分页;外部越界先钳制,signal 等值写回不触发,双向同步收敛安全 ——
if (props.page) {
const pageSig = props.page;
@@ -192,6 +191,7 @@ export function dataTable<T extends { id: RowKey }>(props: DataTableProps<T>): H
info,
total: () => visible().total,
loading: busy,
pageSizes: props.pageSizes,
onPage: (page) => table.dispatch({ type: 'setPage', page }),
onPageSize: (pageSize) => table.dispatch({ type: 'setPageSize', pageSize }),
}),