<BasicTable @register="registerTable">
<template #bodyCell="{ column, record, index }">
<template>
<div :style="getCellStyle(column, record)" >
{{ record[column.dataIndex] }}
</div>
</template>
</template>
</BasicTable>
<script>
const [registerTable,{setTableData}] = useTable({
scroll: { x: '100%' },//重要的是这一句
});
const getCellStyle = (column, record) => {
return {
display: '-webkit-box',
overflow: 'hidden' /* 确保超出的内容会被隐藏 */,
'white-space': 'nowrap' /* 确保文本在一行内显示,不换行 */,
'text-overflow': 'ellipsis' /* 使用省略号表示被截断的文本 */,
color: color,
};
};
</script>
antdv BasicTable单元格有错位,设置行字体颜色
最新推荐文章于 2024-07-24 21:13:23 发布