From f5e24c3ffff9d8f66f7746fb7fc795cc51b8ad46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BA=AE=E4=BA=AE?= Date: Tue, 16 Jan 2024 10:45:38 +0800 Subject: [PATCH] =?UTF-8?q?css:=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/UploadImages.vue | 46 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) 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) - } - ] - }); + } } });