import copy from 'copy-to-clipboard';
const handleCopyPageLink = (record: any) => {
const { id } = record;
const articleLink = `${pageLink}/${id}`;
if (copy(`${articleLink}`)) {
message.success('已复制');
}
};
{
title: '文章链接',
dataIndex: 'id',
width: '250px',
ellipsis: {
showTitle: false,
},
render: (content: string | any, record: any) => (
handleCopyPageLink(record)}>
复制
{`${pageLink}/${content}`}
),
},
React 中使用copy-to-clipboard
关注
打赏