// create URL and Link
const url = window.URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = filename;
document.body.appendChild(a);
// Invoke download
a.click();
// remove URL and Link
window.URL.revokeObjectURL(url);
a.remove();
原文出处:http://www.dongblog.com/notes/4.html
来源:博客网 转载请注明出处!