From a817ec68db5bdcca583daf9c3225fd51c7566792 Mon Sep 17 00:00:00 2001 From: sc Date: Fri, 21 May 2021 09:28:03 +0800 Subject: [PATCH] Update multiple.vue --- src/components/scUpload/multiple.vue | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/scUpload/multiple.vue b/src/components/scUpload/multiple.vue index 932222fc..61408e6d 100644 --- a/src/components/scUpload/multiple.vue +++ b/src/components/scUpload/multiple.vue @@ -1,6 +1,5 @@ @@ -84,9 +81,7 @@ success_length += 1 } }) - return success_length == all_length - } }, mounted() { @@ -114,15 +109,17 @@ toStr(arr){ var _arr = []; arr.forEach(item => { - - _arr.push(item.url) - + _arr.push(item.url) }) var str = _arr.join(",") return str; }, - before(){ - + before(file){ + const maxSize = file.size / 1024 / 1024 < this.maxSize; + if (!maxSize) { + this.$message.warning('上传文件大小不能超过 10MB!'); + return false; + } }, change(file, fileList){ file.tempImg = URL.createObjectURL(file.raw); @@ -159,7 +156,7 @@ .sc-upload-list {display: inline-block;} - .sc-upload-list li {list-style: none;display: inline-block;width: 120px;height: 120px;margin-right: 10px;} + .sc-upload-list li {list-style: none;display: inline-block;width: 120px;height: 120px;margin-right: 10px;vertical-align: top;box-sizing: border-box;} .sc-upload-item {position: relative;width: 100%;height: 100%;} .sc-upload-item .mask {display: none;position: absolute;top:0px;right:0px;line-height: 1;z-index: 1;}