通过a标签// 创建a标签const link = document.createElement(a)// download属性link.setAttribute(download, row.newName)// href链接link.setAttribute(href, row.downloadPath)// 自执行点击事件link.click...

通过a标签
// 创建a标签 const link = document.createElement('a') // download属性 link.setAttribute('download', row.newName) // href链接 link.setAttribute('href', row.downloadPath) // 自执行点击事件 link.click() document.body.removeChild(link)
通过open
window.open(row.downloadPath)
织梦狗教程
本文标题为:vue通过地址下载文件


基础教程推荐
猜你喜欢
- 原生ajax瀑布流demo分享(必看篇) 2023-02-01
- ajax实现数据分页查询 2023-01-31
- 在IE中为abbr标签加样式 2022-10-16
- 解决:layUI数据表格+简单查询 2022-12-16
- 关于ajax异步访问数据的问题 2023-02-23
- JavaScript垃圾回收机制(引用计数,标记清除,性能优 2022-08-31
- AJax 把拿到的后台数据在页面中渲染的实例 2023-02-22
- Unicode中的常用字母小结 2022-09-21
- Ajax提交表单并接收json实例代码 2023-02-13
- 纯javascript的ajax实现php异步提交表单的简单实例 2022-12-28