From 8e29bd72d0db52a0ac2f80c57a1b48fdcc6dc06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Tue, 30 Jan 2024 17:03:09 +0800 Subject: [PATCH] fix 81427 --- src/pages/page1/App.vue | 638 +++++++++++---------- src/pages/page1/components/InsertImage.vue | 13 +- 2 files changed, 332 insertions(+), 319 deletions(-) diff --git a/src/pages/page1/App.vue b/src/pages/page1/App.vue index 6e0d70e..b02c102 100644 --- a/src/pages/page1/App.vue +++ b/src/pages/page1/App.vue @@ -1,344 +1,348 @@ diff --git a/src/pages/page1/components/InsertImage.vue b/src/pages/page1/components/InsertImage.vue index 43630dc..4057d84 100644 --- a/src/pages/page1/components/InsertImage.vue +++ b/src/pages/page1/components/InsertImage.vue @@ -548,11 +548,13 @@ export default { beforeUpload (file) { const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' if (!isJpgOrPng) { - this.$message.error('You can only upload JPG file!') + this.$message.error('只能上传图片') + return false } const isLt2M = file.size / 1024 / 1024 < 2 if (!isLt2M) { - this.$message.error('Image must smaller than 2MB!') + this.$message.error('图片大小不能超过2MB') + return false } return isJpgOrPng && isLt2M }, @@ -654,4 +656,11 @@ export default { margin-top: 8px; color: #666; } + +.ant-upload-select-picture-card { + img { + max-width: 100%; + height: auto !important; + } +}