@@ -54,6 +54,7 @@ interface Props {
5454 canDrag? : (row : TreeRow <T >) => boolean ;
5555 canDropInside? : (row : TreeRow <T >) => boolean ;
5656 enableResizing? : boolean ;
57+ columnSizing? : Record <string , number >;
5758}
5859
5960const props = withDefaults (defineProps <Props >(), {
@@ -67,6 +68,7 @@ const props = withDefaults(defineProps<Props>(), {
6768 // searchableKeys default removed, will handle in getter if needed or empty
6869 includeMetaInSearch: true ,
6970 enableResizing: false ,
71+ columnSizing : () => ({}),
7072});
7173
7274const emit = defineEmits <{
@@ -81,6 +83,7 @@ const emit = defineEmits<{
8183 ): void ;
8284 (e : ' row:drop' , payload : DropEvent <T >): void ;
8385 (e : ' update:selectedIds' , value : string []): void ;
86+ (e : ' update:columnSizing' , value : Record <string , number >): void ;
8487}>();
8588
8689const UButton = resolveComponent (' UButton' );
@@ -92,6 +95,8 @@ const selectedIdsRef = ref(props.selectedIds);
9295const tableContainerRef = ref <HTMLElement | null >(null );
9396const columnVisibility = ref <Record <string , boolean >>({});
9497
98+ const columnSizing = defineModel <Record <string , number >>(' columnSizing' , { default : () => ({}) });
99+
95100type ColumnHeaderRenderer = TableColumn <TreeRow <T >>[' header' ];
96101
97102watch (
@@ -459,6 +464,7 @@ function enhanceRowInstance(row: TableInstanceRow<T>): EnhancedRow<T> {
459464 ref =" tableRef"
460465 v-model:row-selection =" rowSelection"
461466 v-model:column-visibility =" columnVisibility"
467+ v-model:column-sizing =" columnSizing"
462468 :data =" flattenedData"
463469 :columns =" processedColumns"
464470 :get-row-id =" (row: any) => row.id"
0 commit comments