File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Changelog:
3
+ * 1. 修改 use-clippy 为 @dtinsight/dt-utils 中的 CopyUtils,原因详见 https://github.com/DTStack/dt-react-component/issues/540
4
+ */
1
5
import React , { CSSProperties , ReactNode } from 'react' ;
6
+ import { CopyUtils } from '@dtinsight/dt-utils' ;
2
7
import { message , Tooltip } from 'antd' ;
3
8
import classNames from 'classnames' ;
4
- import useClippy from 'use-clippy' ;
5
9
6
10
import { LabelTooltipType , toTooltipProps } from '../utils' ;
7
11
import './style.scss' ;
@@ -40,11 +44,9 @@ const Copy: React.FC<ICopyProps> = (props) => {
40
44
className,
41
45
onCopy = ( ) => message . success ( '复制成功' ) ,
42
46
} = props ;
43
- const [ _ , setClipboard ] = useClippy ( ) ;
44
47
45
48
const handleCopy = ( ) => {
46
- setClipboard ( text ) ;
47
- onCopy ( text ) ;
49
+ new CopyUtils ( ) . copy ( text , ( ) => onCopy ( text ) ) ;
48
50
} ;
49
51
50
52
const renderCopyButton = ( ) => (
You can’t perform that action at this time.
0 commit comments