diff --git a/src/views/UploadImages.vue b/src/views/UploadImages.vue index 439d3e8..4b91913 100644 --- a/src/views/UploadImages.vue +++ b/src/views/UploadImages.vue @@ -40,14 +40,7 @@ 已选择 {{ convertedImages.length }} 张,共 {{ formatBytes(imagesTotalSize) }} -
-
- - 剪切板上传 -
-
+
+
+ + 上传剪切板 +
+
{ - const file = new File([blob], "clipboard.png", { - type: "image/png", + if (item.types.includes("image/png")) { + + item.getType("image/png").then(blob => { + const file = new File([blob], "clipboard.png", { + type: "image/png", + }); + convertedImages.value = [ + ...convertedImages.value, + { + file, + tmpSrc: URL.createObjectURL(file) + } + ] }); - convertedImages.value = [ - ...convertedImages.value, - { - file, - tmpSrc: URL.createObjectURL(file) - } - ] - }); + } } });