图片上传
This commit is contained in:
parent
735f73882d
commit
564a26e330
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue