小调整。

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 {
if (typeof info.mimetype === "string") {
const blob = new Blob([data], { type: info.mimetype });
const data = [new ClipboardItem({ [info.mimetype]: blob })];
await navigator.clipboard.write(data);
const mimeType = info.mimetype;
if (typeof mimeType === "string") {
const blob = new Blob([data], { type: mimeType });
const clipboardItem = [new ClipboardItem({ [mimeType]: blob })];
await navigator.clipboard.write(clipboardItem);
} else {
// data转换为string类型
if (typeof data === "object") {