案例修改、图片预览
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
:file-list="upload.fileList"
|
||||
:multiple="upload.multiple"
|
||||
:on-change="handleFileChange"
|
||||
:on-remove="handleFileRemove"
|
||||
:on-exceed="handleFileexceed"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
@ -17,7 +18,7 @@
|
||||
:auto-upload="false">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">每个案例最多上传5个文件,且每个文件不超过10M</div>
|
||||
<div class="el-upload__tip" slot="tip">最多可上传{{upload.limit}}个文件,且每个文件不超过{{upload.fileSize/(1024*1024)}}M</div>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script>
|
||||
@ -41,8 +42,8 @@ export default {
|
||||
//文件列表
|
||||
fileList:[],
|
||||
//同时上传文件上限
|
||||
limit: 5,
|
||||
//每个文件大小
|
||||
limit: 10,
|
||||
//每个文件大小(单位:byte)
|
||||
fileSize: 1024 * 1024 * 10,
|
||||
//是否支持同时选择多张
|
||||
multiple: true
|
||||
@ -66,6 +67,10 @@ export default {
|
||||
this.uploadResult["fileUrl"] = [];
|
||||
this.uploadResult["fileName"] = [];
|
||||
},
|
||||
//移除文件
|
||||
handleFileRemove(file, fileList){
|
||||
this.upload.fileList = fileList;
|
||||
},
|
||||
//监控上传文件列表
|
||||
handleFileChange(file, fileList) {
|
||||
let sizeFlag = file.size > this.upload.fileSize;
|
||||
@ -110,9 +115,10 @@ export default {
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
this.uploadReset();
|
||||
},
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user