mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-04-24 10:48:16 +00:00
feat(table): 支持列排序配置
- design: TableColumnOptions.sortable 支持 boolean | string - table: 将 sortable 传递到表格列配置 Made-with: Cursor
This commit is contained in:
parent
7249b5106e
commit
4cd54d1397
@ -342,7 +342,7 @@ export interface TableColumnOptions<T = any> {
|
|||||||
prop?: string;
|
prop?: string;
|
||||||
align?: string;
|
align?: string;
|
||||||
headerAlign?: string;
|
headerAlign?: string;
|
||||||
sortable?: boolean;
|
sortable?: boolean | string;
|
||||||
sortOrders?: Array<'ascending' | 'descending'>;
|
sortOrders?: Array<'ascending' | 'descending'>;
|
||||||
selectable?: (row: T, index: number) => boolean;
|
selectable?: (row: T, index: number) => boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -139,6 +139,7 @@ const tableColumns = computed(() =>
|
|||||||
prop: item.prop,
|
prop: item.prop,
|
||||||
type,
|
type,
|
||||||
selectable: item.selectable,
|
selectable: item.selectable,
|
||||||
|
sortable: item.sortable,
|
||||||
},
|
},
|
||||||
cell: type === 'selection' ? undefined : ({ row, $index }: any) => cellRender(item, { row, $index }),
|
cell: type === 'selection' ? undefined : ({ row, $index }: any) => cellRender(item, { row, $index }),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user