原始
{
title: '链接URL',
dataIndex: 'url',
key: 'url',
width: urlColumnWidth, // 使用主表格链接数列的宽度
render: (url: string) => (
<a
href={`https://${url}`}
target="_blank"
rel="noopener noreferrer"
style={{
color: '#1890ff',
wordBreak: 'break-all',
display: 'block',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
title={url}
>
{isMobile && url.length > 30
? `${url.substring(0, 30)}...`
: url}
</a>
),
},
加tip, 注意zIndex 防止显示在最底层了
{
title: '链接URL',
dataIndex: 'url',
key: 'url',
width: urlColumnWidth,
render: (url: string) => {
const urlAlias = getUrlalias ? getUrlalias(url) : '';
return (
<Tooltip
title={urlAlias ? `别名: ${urlAlias}` : url}
placement="top"
mouseEnterDelay={0.5}
overlayStyle={{
zIndex: 100000, // 提高 z-index
}}
>
<a
href={`https://${url}`}
target="_blank"
rel="noopener noreferrer"
style={{
color: '#1890ff',
wordBreak: 'break-all',
display: 'block',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
title={url}
>
{isMobile && url.length > 30
? `${url.substring(0, 30)}...`
: url}
</a>
</Tooltip>
);
},
},