一:
const eleLink = document.createElement("a");
eleLink.href = CONFIG.Log_download // 下載的路徑
eleLink.download = '操作日志';// 設(shè)置下載的name屬性,可以為空
eleLink.style.display = "none";
document.body.appendChild(eleLink);
eleLink.click();
document.body.removeChild(eleLink);
二:
var a = document.createElement('a')
a.href = 'xxxxx'
a.download = 'xxxx'
a.click()
a = null