提交 e09e0a12 编写于 作者: V vben

fix(table): wrong tag label style #134

上级 d9b58e46
......@@ -40,12 +40,12 @@ function handleIndexColumn(
getPaginationRef: ComputedRef<boolean | PaginationProps>,
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;
});
......
......@@ -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;
......
......@@ -10,6 +10,12 @@
:imgList="['https://picsum.photos/id/66/346/216', 'https://picsum.photos/id/67/346/216']"
/>
</template>
<template #category="{ record }">
<Tag color="green">
{{ record.no }}
</Tag>
</template>
</BasicTable>
</div>
</template>
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册