| | |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true" |
| | | :min-width="columnWidth(item)" |
| | | :min-width="columnMinWidth(item)" |
| | | :sortable="item.sortable ? true : false" |
| | | :type="item.type" |
| | | :width="columnWidth(item)" |
| | |
| | | }) |
| | | |
| | | function columnWidth(item) { |
| | | if (item.minWidth) return undefined |
| | | return item.dataType === 'action' ? actionColumnWidth.value : item.width |
| | | } |
| | | |
| | | // 配置 minWidth 时只约束最小宽度,把剩余空间交给 Element Plus 自动分配。 |
| | | // 未配置 minWidth 的旧页面继续沿用原有固定 width 行为。 |
| | | function columnMinWidth(item) { |
| | | if (item.minWidth) return item.minWidth |
| | | return item.dataType === 'action' ? actionColumnWidth.value : item.width |
| | | } |
| | | |