This commit is contained in:
parent
1ed45a233e
commit
195d7d570a
|
|
@ -12,7 +12,7 @@
|
|||
<slot>
|
||||
<div class="file-empty">
|
||||
<i :class="icon"></i>
|
||||
<h4>{{title}}</h4>
|
||||
<h4 v-if="title">{{title}}</h4>
|
||||
</div>
|
||||
</slot>
|
||||
</el-upload>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
action: { type: String, default: "#" },
|
||||
accept: { type: String, default: ".jpg, .png, .jpeg, .gif" },
|
||||
maxSize: { type: Number, default: 10 },
|
||||
title: { type: String, default: "上传" },
|
||||
title: { type: String, default: "" },
|
||||
icon: { type: String, default: "el-icon-plus" },
|
||||
onSuccess: { type: Function, default: () => { return true } }
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<el-upload ref="upload" class="uploader" :action="action" :accept="accept" multiple :show-file-list="false" :file-list="defaultFileList" :before-upload="before" :on-progress="progress" :on-success="success" :on-change="change" :on-remove="remove" :on-error="error">
|
||||
<div class="file-empty">
|
||||
<i :class="icon"></i>
|
||||
<h4>{{title}}</h4>
|
||||
<h4 v-if="title">{{title}}</h4>
|
||||
</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
action: { type: String, default: "#" },
|
||||
accept: { type: String, default: ".jpg, .png, .jpeg, .gif" },
|
||||
maxSize: { type: Number, default: 10 },
|
||||
title: { type: String, default: "上传" },
|
||||
title: { type: String, default: "" },
|
||||
icon: { type: String, default: "el-icon-plus" }
|
||||
},
|
||||
data(){
|
||||
|
|
@ -144,7 +144,6 @@
|
|||
},
|
||||
del(index){
|
||||
this.fileList.splice(index, 1);
|
||||
this.$refs.upload.uploadFiles.splice(index-this.fileList.length-1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
<el-card shadow="never" header="基础示例">
|
||||
<sc-upload v-model="imgurl" :action="uploadUrl"></sc-upload>
|
||||
<sc-upload v-model="avatar" title="自定义" icon="el-icon-picture-outline" :action="uploadUrl"></sc-upload>
|
||||
<sc-upload v-model="avatar" title="自定义" icon="el-icon-picture-outline" :action="uploadUrl" accept=".xls,.xlsx" :on-success="success" :width="220">
|
||||
<sc-upload v-model="avatar" title="自定义标题" icon="el-icon-picture-outline" :action="uploadUrl"></sc-upload>
|
||||
<sc-upload v-model="avatar" :action="uploadUrl" accept=".xls,.xlsx" :on-success="success" :width="220">
|
||||
<div class="custom-empty">
|
||||
<i class="el-icon-upload"></i>
|
||||
<p>自定义插槽</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue