|
|
<template>
|
|
|
<Upload ref="upload"
|
|
|
<Upload ref="upload"
|
|
|
:id="id"
|
|
|
:action="action"
|
|
|
:data="data"
|
|
|
:accept="accept"
|
...
|
...
|
@@ -35,7 +36,8 @@ export default { |
|
|
maxSize: {
|
|
|
type: Number,
|
|
|
default: 512 * 1024
|
|
|
}
|
|
|
},
|
|
|
id: ''
|
|
|
},
|
|
|
data() {
|
|
|
return {};
|
...
|
...
|
@@ -47,11 +49,11 @@ export default { |
|
|
if (_.get(response, 'data.imagesList.length', 0)) {
|
|
|
files = response.data.imagesList;
|
|
|
}
|
|
|
this.$emit('on-success', files);
|
|
|
this.$emit('on-success', this.id, files);
|
|
|
},
|
|
|
error(error) {
|
|
|
this.$Message.error('上传失败');
|
|
|
this.$emit('on-error', error);
|
|
|
this.$emit('on-error', this.id, error);
|
|
|
},
|
|
|
beforeUpload() {
|
|
|
this.$refs.upload.clearFiles();
|
...
|
...
|
|