fujianList.vue
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<div style="widht:100px;height:42px">
<el-upload
class="upload-demo"
:on-remove="handleRemove"
:action="uploadUrl"
:on-success="handleUploadSuccess"
:file-list="fileData"
:auto-upload="true"
>
<div class="greens" v-if="fileData.length ==0"> + 点击上传</div>
</el-upload>
</div>
</template>
<script>
import {
uploadUrl
} from '@/utils/request'
export default {
data() {
return {
uploadFileUrl: uploadUrl, // 请求地址
fileData:[],//上传附件
}
},
created() {
},
computed: {
},
methods: {
getFu(){
this.$emit('childFujian', this.fileData);
},
handleRemove(file, fileList) {
this.fileData = []
},
handleUploadSuccess(response, file, fileList) {
const fileMsg = {
name:file.name,
url: file.response.data.url,
}
// 将文件地址存储在 uploadedFiles 数组中
this.fileData.push(fileMsg);
},
}
}
</script>
<style>
</style>