支持文件列表可指定下载文件名
This commit is contained in:
@@ -47,13 +47,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
downFile(item) {
|
downFile(item) {
|
||||||
if (this.clickDownload) {
|
if (this.clickDownload) {
|
||||||
const link = document.createElement('a')
|
this.$download(item.url, item.name)
|
||||||
link.style.display = 'none'
|
|
||||||
link.href = item.url
|
|
||||||
link.setAttribute('download', item.name)
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
} else window.open(`${item.url}`)
|
} else window.open(`${item.url}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user