fix 81427

This commit is contained in:
赵霄
2024-01-30 17:03:09 +08:00
parent 095fea4bde
commit 8e29bd72d0
2 changed files with 332 additions and 319 deletions
+11 -2
View File
@@ -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;
}
}
</style>