|
|
@@ -26,7 +26,7 @@
|
|
|
<!-- 文件列表 -->
|
|
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
|
|
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
|
|
- <el-link :href="file.url" :underline="false" target="_blank">
|
|
|
+ <el-link :href="getFileUrl(file.name)" :underline="false" target="_blank">
|
|
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
|
|
</el-link>
|
|
|
<div class="ele-upload-list__item-content-action">
|
|
|
@@ -182,6 +182,13 @@ export default {
|
|
|
// 返回 name 属性
|
|
|
return fileObj.name;
|
|
|
},
|
|
|
+ // 获取文件url
|
|
|
+ getFileUrl(name) {
|
|
|
+ // 将字符串的 JSON 转换为对象
|
|
|
+ const fileObj = JSON.parse(name);
|
|
|
+ // 返回 name 属性
|
|
|
+ return fileObj.url;
|
|
|
+ },
|
|
|
|
|
|
//自定义上传方式(自带的成功回调及失败回调会失效)
|
|
|
uploadFile(fileObj) {
|