fix 81427
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user