From 8a9d88ac9008886ba920ecc54b2870d6ab750bf7 Mon Sep 17 00:00:00 2001 From: skyfeiz Date: Tue, 23 Dec 2025 18:07:26 +0800 Subject: [PATCH] type(Table): add support for the number type to width and minWidth. --- docs/en-US/components/Table.md | 4 ++-- docs/zh-CN/components/Table.md | 4 ++-- src/Table/type.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/en-US/components/Table.md b/docs/en-US/components/Table.md index 8eb59212..5c65ba48 100644 --- a/docs/en-US/components/Table.md +++ b/docs/en-US/components/Table.md @@ -198,8 +198,8 @@ The function `defineTableColumns` supports passing in a Generics type to infer t | hide | Whether to hide in the table | boolean | - | false | | children | grouping table head | array | - | - | | columnKey | column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered | string | - | - | -| width | column width | string | - | - | -| minWidth | column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion | string | - | - | +| width | column width | string / number | - | - | +| minWidth | column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion | string / number | - | - | | fixed | whether column is fixed at left/right. Will be fixed at left if `true` | string / boolean | true / left / right | - | | renderHeader | render function for table header of this column | Function(h, { column, $index }) | - | - | | sortable | whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table | boolean / string | true / false / 'custom' | false | diff --git a/docs/zh-CN/components/Table.md b/docs/zh-CN/components/Table.md index 17cd679f..9b9519b3 100644 --- a/docs/zh-CN/components/Table.md +++ b/docs/zh-CN/components/Table.md @@ -198,8 +198,8 @@ meta: | hide | 是否在表格中隐藏 | boolean | - | false | | children | 实现多级表头 | array | - | - | | columnKey | 当前项的 key,使用 filter-change 事件时需要 | string | - | - | -| width | 对应列的宽度 | string | - | - | -| minWidth | 对应列的最小宽度 | string | - | - | +| width | 对应列的宽度 | string / number | - | - | +| minWidth | 对应列的最小宽度 | string / number | - | - | | fixed | 列是否固定,true 表示固定在左侧 | string / boolean | true / left / right | - | | renderHeader | 列标题 Label 区域渲染使用的 Function | Function({ column, $index }) | - | - | | sortable | 对应列是否可以排序 | boolean / string | true / false / 'custom' | false | diff --git a/src/Table/type.ts b/src/Table/type.ts index 59780f4b..bd37b34a 100644 --- a/src/Table/type.ts +++ b/src/Table/type.ts @@ -26,9 +26,9 @@ export interface TableCommonColumn /** column label */ label?: string /** column width */ - width?: string + width?: string | number /** column minimum width. Columns with width has a fixed width, while columns with min-width has a width that is distributed in proportion */ - minWidth?: string + minWidth?: string | number /** whether column is fixed at `left` `right` */ fixed?: boolean | 'left' | 'right' /** render function for table header of this column */