mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-19 17:35:53 +08:00
修改上传图片大小限制,最大1M
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif','bmp']"
|
||||
accept=".jpg, .jpeg, .png, .gif, .bmp"
|
||||
:max-size="maxSize*1024"
|
||||
:max-size="1024"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -74,10 +74,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
maxlength: Number,
|
||||
icon: {
|
||||
type: String,
|
||||
@@ -116,7 +112,7 @@ export default {
|
||||
this.loading = false;
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件‘ " + file.name + " ’大小过大, 不得超过 " + this.maxSize + "M."
|
||||
desc: "所选文件大小过大, 不得超过1M."
|
||||
});
|
||||
},
|
||||
// 上传前
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif']"
|
||||
:max-size="maxSize*1024"
|
||||
:max-size="1024"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="handleBeforeUpload"
|
||||
@@ -72,10 +72,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 10
|
||||
@@ -147,11 +143,7 @@ export default {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc:
|
||||
"所选文件‘ " +
|
||||
file.name +
|
||||
" ’大小过大, 不得超过 " +
|
||||
this.maxSize +
|
||||
"M."
|
||||
"所选文件大小过大,不能超过1M."
|
||||
});
|
||||
},
|
||||
// 上传之前钩子
|
||||
|
||||
Reference in New Issue
Block a user