Js下载文件
Js下载文件
/**
* 下载文件
* @param path
* @param name
*/
downFile (path, name) {
let link = document.createElement('a')
link.style.display = 'none'
link.href = path
link.setAttribute('download', name)
document.body.appendChild(link)
link.click()
}
本文来自博客园,作者:爱吃糖的橘猫,转载请注明原文链接:https://www.cnblogs.com/sglblog/p/16628562.html