小调整。

scripts
王良 2024-09-05 15:59:33 +08:00
parent 9b832b68fb
commit 49e7ef48aa
1 changed files with 5 additions and 4 deletions

View File

@ -644,10 +644,11 @@
} }
try { try {
if (typeof info.mimetype === "string") { const mimeType = info.mimetype;
const blob = new Blob([data], { type: info.mimetype }); if (typeof mimeType === "string") {
const data = [new ClipboardItem({ [info.mimetype]: blob })]; const blob = new Blob([data], { type: mimeType });
await navigator.clipboard.write(data); const clipboardItem = [new ClipboardItem({ [mimeType]: blob })];
await navigator.clipboard.write(clipboardItem);
} else { } else {
// data转换为string类型 // data转换为string类型
if (typeof data === "object") { if (typeof data === "object") {