This commit is contained in:
chenjiajun
2020-10-25 15:39:04 +08:00
parent 71795b2a27
commit 2ce24c8a2d
10 changed files with 65 additions and 189 deletions

View File

@ -45,9 +45,9 @@ export default {
},
// 限制图片上传大小
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 4
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 4MB!')
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isLt2M
}

View File

@ -45,9 +45,9 @@ export default {
},
// 限制图片上传大小
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 4
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 4MB!')
this.$message.error('上传头像图片大小不能超过 2MB!')
}
return isLt2M
}