Skip to content

Commit 6d8ad98

Browse files
committed
fix(copy): #540 optimize Copy
1 parent 5a3a465 commit 6d8ad98

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/copy/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { CSSProperties, ReactNode } from 'react';
2+
import { CopyUtils } from '@dtinsight/dt-utils';
23
import { message, Tooltip } from 'antd';
34
import classNames from 'classnames';
4-
import useClippy from 'use-clippy';
55

66
import { LabelTooltipType, toTooltipProps } from '../utils';
77
import './style.scss';
@@ -40,11 +40,9 @@ const Copy: React.FC<ICopyProps> = (props) => {
4040
className,
4141
onCopy = () => message.success('复制成功'),
4242
} = props;
43-
const [_, setClipboard] = useClippy();
4443

4544
const handleCopy = () => {
46-
setClipboard(text);
47-
onCopy(text);
45+
new CopyUtils().copy(text, () => onCopy(text));
4846
};
4947

5048
const renderCopyButton = () => (

0 commit comments

Comments
 (0)