feat(table): 支持列排序配置

- design: TableColumnOptions.sortable 支持 boolean | string
- table: 将 sortable 传递到表格列配置

Made-with: Cursor
This commit is contained in:
roymondchen 2026-04-23 20:04:44 +08:00
parent 7249b5106e
commit 4cd54d1397
2 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,7 @@ export interface TableColumnOptions<T = any> {
prop?: string;
align?: string;
headerAlign?: string;
sortable?: boolean;
sortable?: boolean | string;
sortOrders?: Array<'ascending' | 'descending'>;
selectable?: (row: T, index: number) => boolean;
};

View File

@ -139,6 +139,7 @@ const tableColumns = computed(() =>
prop: item.prop,
type,
selectable: item.selectable,
sortable: item.sortable,
},
cell: type === 'selection' ? undefined : ({ row, $index }: any) => cellRender(item, { row, $index }),
};