dom
<el-col :span="24">
<el-form-item :label="文件下载">
<el-button v-for="(item,index) in fileList2" :key="item" type="text" @click="eipDownLoad(item,index)">
下载{{index+1}}</el-button>
</el-form-item>
</el-col>
js
eipDownLoad(url,index) {
let link =document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', `file${index+1}`) //指定下载后的文件名,防跳转,名字必须加
document.body.appendChild(link)
link.click()
// 清理临时链接元素
document.body.removeChild(link);
},