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
| <template>
| <div class="upload-attachment">
| <el-upload
| action="#"
| :file-list="fileList"
| :auto-upload="false"
| :on-change="handleFileChange"
| :on-remove="handleFileRemove"
| multiple
| >
| <el-button size="small" type="primary">点击上传</el-button>
| <div slot="tip" class="el-upload__tip">支持jpg、png、pdf、doc、docx等格式,单个文件不超过10MB</div>
| </el-upload>
| </div>
| </template>
|
| <script>
| export default {
| name: "UploadAttachment",
| props: {
| fileList: {
| type: Array,
| default: () => []
| }
| },
| methods: {
| handleFileChange(file, fileList) {
| this.$emit('change', fileList);
| },
| handleFileRemove(file, fileList) {
| this.$emit('change', fileList);
| }
| }
| };
| </script>
|
|