Skip to content

Commit ae53ca6

Browse files
author
puhui999
committed
feat:文件上传组件的文件列表拓展一个下载
1 parent 9a36d9d commit ae53ca6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/components/UploadFile/src/UploadFile.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@
3232
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
3333
</div>
3434
</template>
35+
<template #file="row">
36+
<div class="flex items-center">
37+
<span>{{ row.file.name }}</span>
38+
<div class="ml-10px">
39+
<el-link
40+
:href="row.file.url"
41+
:underline="false"
42+
download
43+
target="_blank"
44+
type="primary"
45+
>
46+
下载
47+
</el-link>
48+
</div>
49+
<div class="ml-10px">
50+
<el-button link type="danger" @click="handleRemove(row.file)"> 删除</el-button>
51+
</div>
52+
</div>
53+
</template>
3554
</el-upload>
3655
</div>
3756
</template>

0 commit comments

Comments
 (0)