Commit 9bca25ba authored by 杨南鸿's avatar 杨南鸿

更新upload组件参数

parent 4b4f75fa
......@@ -103,6 +103,10 @@ export default {
onExceed: {
type: Function,
default: noop
},
needTitle: {
type: Boolean,
default: false
}
},
......@@ -306,6 +310,7 @@ export default {
listType: this.listType,
disabled: this.uploadDisabled,
limit: this.limit,
needTitle: this.needTitle,
'on-exceed': this.onExceed,
'on-start': this.handleStart,
'on-progress': this.handleProgress,
......
......@@ -9,6 +9,10 @@ export default {
},
props: {
type: String,
needTitle: {
type: Boolean,
default: false
},
action: {
type: String,
required: true
......@@ -85,6 +89,11 @@ export default {
this.$refs.input.value = null;
if (!this.beforeUpload) {
return this.post(rawFile);
}
if (!this.beforeUpload) {
if (this.needTitle) {
let fileIndex = this.fileList.findIndex(o => o.uid === rawFile.uid);
let file = this.fileList[fileIndex];
let filename = file.name;
......@@ -100,6 +109,9 @@ export default {
}
}
return this.post(rawFile, filename, fileIndex);
} else {
return this.post(rawFile);
}
}
const before = this.beforeUpload(rawFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment