Skip to content

Commit

Permalink
feat(crud): 添加最小列宽支持
Browse files Browse the repository at this point in the history
  • Loading branch information
develop-chen committed Jul 4, 2024
1 parent 1ef9aec commit 9aba328
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/ma-crud/components/column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<a-table-column
:title="row.title"
:width="row.width"
:min-width="row.minWidth"
:ellipsis="row.ellipsis ?? true"
:filterable="row.filterable"
:cell-class="row.cellClass"
Expand Down Expand Up @@ -38,6 +39,7 @@
:title="row.title"
:data-index="row.dataIndex"
:width="row.width"
:min-width="row.minWidth"
:ellipsis="row.ellipsis ?? true"
:filterable="row.filterable"
:cell-class="row.cellClass"
Expand Down
1 change: 1 addition & 0 deletions src/components/ma-crud/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ columns.value.map((item, index) => {
item = columns.value[index]
}
!item.width && (item.width = options.value.columnWidth)
!item.minWidth && (item.minWidth = options.value.columnMinWidth)
})

provide('options', options.value)
Expand Down
3 changes: 2 additions & 1 deletion src/components/ma-crud/js/defaultOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default {
// 页面布局方式,支持 normal(标准)和 fixed(固定)两种
pageLayout: 'normal',
// 默认统一设置列宽度
columnWidth: 100,
columnWidth: 0,// 列宽更新为最小列宽(此处设置为 0 时候,默认最小列宽生效)
columnMinWidth: 100,
// 搜索标签对齐方式
searchLabelAlign: 'right',
// 全局搜索标签宽度
Expand Down

0 comments on commit 9aba328

Please sign in to comment.