html部分:
<el-row style="border:1px solid #DCDFE6FF;width: 100%;height: 386px; overflow-y: auto;">
<el-row style="height:65px;width: 100%; border-bottom:1px solid #DCDFE6FF;line-height: 65px;"
v-for="(item, index) in details.proFileList"
:key="index">
<el-button style="border:none;color: #0FC6C2FF;background-color: none;"
@click="downloadAll(details.proFileList)"
icon="el-icon-bottom">{{item.attachmentId}}</el-button>
</el-row>
</el-row>
data数据:
//文件
proFileList: [
{
id: "",//id
projectId: "",//所属标的项目
attachmentId: "",//附件标题
type: null,//附件类型
filePath: "",//附件路径
fileFormat: "",//附件格式
},
js部分:
// 下载文件
downloadAll (proFileList) {
this.$download.saveAs(
process.env.VUE_APP_BASE_API + proFileList.filePath,
proFileList.attachmentId
);
}