mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 19:07:25 +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"
|
||||
@@ -71,10 +71,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maxSize: { // 图片最大尺寸
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
maxlength: Number, // 最大长度
|
||||
icon: { // 上传按钮图标
|
||||
type: String,
|
||||
@@ -113,7 +109,7 @@ export default {
|
||||
this.loading = false;
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件‘ " + file.name + " ’大小过大, 不得超过 " + this.maxSize + "M."
|
||||
desc: "所选文件大小过大, 不得超过1M."
|
||||
});
|
||||
},
|
||||
// 上传前
|
||||
|
||||
@@ -30,7 +30,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"
|
||||
@@ -74,10 +74,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
maxSize: { // 大小限制 MB
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
disable:{ // 禁止上传
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -154,11 +150,7 @@ export default {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc:
|
||||
"所选文件‘ " +
|
||||
file.name +
|
||||
" ’大小过大, 不得超过 " +
|
||||
this.maxSize +
|
||||
"M."
|
||||
"所选文件大小过大, 不得超过1M."
|
||||
});
|
||||
},
|
||||
handleBeforeUpload() {
|
||||
|
||||
Reference in New Issue
Block a user