作者 chenhongrui

shangchuan

... ... @@ -37,10 +37,6 @@ export default {
handleChange (info) {
if (info.file.status !== 'uploading') {
console.log(info)
console.log(info.file, info.fileList)
console.log(info.file.response.data)
console.log(this.juanlist)
// this.juanlist.push(...info.file.response.data)
this.$emit('uploadwenj', info.file.response.data)
}
if (info.file.status === 'done') {
... ...
<template>
<a-upload
name="file"
:multiple="true"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:headers="headers"
@change="handleChange"
>
<a-button> <a-icon type="upload" /> Click to Upload </a-button>
</a-upload>
</template>
<script>
export default {
name: "UploInd",
data() {
return {
headers: {
authorization: 'authorization-text',
},
};
},
methods: {
handleChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
this.$message.success(`${info.file.name} file uploaded successfully`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} file upload failed.`);
}
},
},
};
</script>
\ No newline at end of file