diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index ffac3b60722..0b4537dc20d 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -40,12 +40,12 @@ function handleIndexColumn( getPaginationRef: ComputedRef, columns: BasicColumn[] ) { - const { showIndexColumn, indexColumnProps, ellipsis } = unref(propsRef); + const { showIndexColumn, indexColumnProps } = unref(propsRef); let pushIndexColumns = false; columns.forEach((item) => { const { children } = item; - handleItem(item, !!ellipsis); + const isTreeTable = children && children.length; const indIndex = columns.findIndex((column) => column.flag === INDEX_COLUMN_FLAG); @@ -114,6 +114,16 @@ export function useColumns( if (!columns) { return []; } + const { ellipsis } = unref(propsRef); + + columns.forEach((item) => { + const { customRender, slots } = item; + + handleItem( + item, + Reflect.has(item, 'ellipsis') ? !!item.ellipsis : !!ellipsis && !customRender && !slots + ); + }); return columns; }); diff --git a/src/components/Table/src/style/index.less b/src/components/Table/src/style/index.less index 212281ac318..d901913f3dd 100644 --- a/src/components/Table/src/style/index.less +++ b/src/components/Table/src/style/index.less @@ -24,20 +24,16 @@ } } - &-img__preview { - display: flex; - - img { - margin-right: 4px; - } - } - &--inset { .ant-table-wrapper { padding: 0; } } + .ant-tag { + margin-right: 0; + } + .ant-table-wrapper { padding: 8px; background: #fff; diff --git a/src/views/demo/table/CustomerCell.vue b/src/views/demo/table/CustomerCell.vue index e9646bff903..ebb0298f37a 100644 --- a/src/views/demo/table/CustomerCell.vue +++ b/src/views/demo/table/CustomerCell.vue @@ -10,6 +10,12 @@ :imgList="['https://picsum.photos/id/66/346/216', 'https://picsum.photos/id/67/346/216']" /> + + @@ -24,6 +30,13 @@ dataIndex: 'id', slots: { customRender: 'id' }, }, + { + title: '分类', + dataIndex: 'category', + width: 80, + align: 'center', + slots: { customRender: 'category' }, + }, { title: '姓名', dataIndex: 'name', @@ -60,6 +73,7 @@ title: '自定义列内容', api: demoListApi, columns: columns, + bordered: true, }); return {