File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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+ */
15import React , { CSSProperties , ReactNode } from 'react' ;
6+ import { CopyUtils } from '@dtinsight/dt-utils' ;
27import { message , Tooltip } from 'antd' ;
38import classNames from 'classnames' ;
4- import useClippy from 'use-clippy' ;
59
610import { LabelTooltipType , toTooltipProps } from '../utils' ;
711import './style.scss' ;
@@ -40,11 +44,9 @@ const Copy: React.FC<ICopyProps> = (props) => {
4044 className,
4145 onCopy = ( ) => message . success ( '复制成功' ) ,
4246 } = props ;
43- const [ _ , setClipboard ] = useClippy ( ) ;
4447
4548 const handleCopy = ( ) => {
46- setClipboard ( text ) ;
47- onCopy ( text ) ;
49+ new CopyUtils ( ) . copy ( text , ( ) => onCopy ( text ) ) ;
4850 } ;
4951
5052 const renderCopyButton = ( ) => (
You can’t perform that action at this time.
0 commit comments