This commit is contained in:
liuye
2023-06-20 16:48:15 +08:00
parent b42d1a0502
commit 3501165a3a

View File

@@ -47,7 +47,13 @@ export default {
methods: {
downFile(item) {
if (this.clickDownload) {
this.$download(item.url, item.name)
const link = document.createElement('a')
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}`)
}
}