📜  表单提交后下载文件 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:13.103000             🧑  作者: Mango

代码示例1
//Use the download attribute.
var link = document.createElement('a');
link.href = url;
link.download = 'file.pdf';
link.dispatchEvent(new MouseEvent('click'));