Skip to content

Commit 34a5a11

Browse files
liujupingJackLian
authored andcommitted
fix: fix clipboard.setData fial in workspace mode
1 parent 8931d83 commit 34a5a11

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/designer/src/designer/clipboard.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class Clipboard implements IClipboard {
3636

3737
private waitFn?: (data: any, e: ClipboardEvent) => void;
3838

39+
constructor() {
40+
this.injectCopyPaster(document);
41+
}
42+
3943
isCopyPasteEvent(e: Event) {
4044
this.isCopyPaster(e.target);
4145
}

packages/designer/src/designer/designer-view.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import BuiltinDragGhostComponent from './drag-ghost';
44
import { Designer, DesignerProps } from './designer';
55
import { ProjectView } from '../project';
66
import './designer.less';
7-
import { clipboard } from './clipboard';
87

98
type IProps = DesignerProps & {
109
designer?: Designer;
@@ -44,7 +43,6 @@ export class DesignerView extends Component<IProps> {
4443
if (onMount) {
4544
onMount(this.designer);
4645
}
47-
clipboard.injectCopyPaster(document);
4846
this.designer.postEvent('mount', this.designer);
4947
}
5048

0 commit comments

Comments
 (0)