图片上传

This commit is contained in:
cwchen 2024-04-24 18:20:50 +08:00
parent 735f73882d
commit 564a26e330
2 changed files with 6 additions and 6 deletions

View File

@ -699,9 +699,9 @@ export default {
},
//
handleImageChange(file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 2;
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
this.$message.error('上传平面图大小不能超过 10MB!');
fileList = fileList.slice(0,-1)//
this.imageList = fileList
this.handleValidateField('dataForm', 'imageList')
@ -712,9 +712,9 @@ export default {
}
},
handleImageChange2(file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 2;
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
this.$message.error('上传图片大小不能超过 10MB!');
fileList = fileList.slice(0,-1)//
this.imageList2 = fileList
this.handleValidateField('dataForm', 'imageList2')

View File

@ -493,9 +493,9 @@ export default {
this.$refs[name].validateField(type)
},
handleImageChange(file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 2;
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
this.$message.error('上传图片大小不能超过 10MB!');
fileList = fileList.slice(0,-1)//
this.imageList = fileList
this.handleValidateField('dataForm', 'imageList')