From c51bf13f50137f7efc296fb496de12900ae6dca4 Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Tue, 23 Jul 2024 11:56:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=BB=98=E8=AE=A4=E5=A4=A7=E5=B0=8F=E7=9A=84=E5=80=BC?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Upload/ImageUpload.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Upload/ImageUpload.vue b/src/components/Upload/ImageUpload.vue index b5992729..a1983292 100644 --- a/src/components/Upload/ImageUpload.vue +++ b/src/components/Upload/ImageUpload.vue @@ -86,7 +86,7 @@ const props = defineProps({ */ uploadMaxSize: { type: Number, - default: 2 * 1048 * 1048, + default: 2 * 1024 * 1024, }, /** * 上传文件类型 @@ -174,8 +174,9 @@ function handleRemove(removeFile: UploadFile) { */ function handleBeforeUpload(file: UploadRawFile) { if (file.size > props.uploadMaxSize) { - let mUploadMaxSize = props.uploadMaxSize / 1024 / 1024; - ElMessage.warning("上传图片不能大于" + mUploadMaxSize + "M"); + ElMessage.warning( + "上传图片不能大于" + props.uploadMaxSize / 1024 / 1024 + "M" + ); return false; } return true;