小调整。

scripts
王良 3 months ago
parent 9b832b68fb
commit 49e7ef48aa

@ -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") {

Loading…
Cancel
Save