fix(canvas): clipboard init error
This commit is contained in:
parent
1132a30483
commit
adb9f6b090
|
@ -73,7 +73,13 @@ class Clipboard implements IClipboard {
|
|||
}
|
||||
const copyPaster = document.createElement<'textarea'>('textarea');
|
||||
copyPaster.style.cssText = 'position: absolute;left: -9999px;top:-100px';
|
||||
if (document.body) {
|
||||
document.body.appendChild(copyPaster);
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.body.appendChild(copyPaster);
|
||||
});
|
||||
}
|
||||
const dispose = this.initCopyPaster(copyPaster);
|
||||
return () => {
|
||||
dispose();
|
||||
|
|
|
@ -15,7 +15,7 @@ export interface IPublicApiMaterial {
|
|||
* set data for Assets
|
||||
* @returns void
|
||||
*/
|
||||
setAssets(assets: IPublicTypeAssetsJson): void;
|
||||
setAssets(assets: IPublicTypeAssetsJson): Promise<void>;
|
||||
|
||||
/**
|
||||
* 获取「资产包」结构
|
||||
|
|
Loading…
Reference in New Issue