📅  最后修改于: 2022-03-11 15:01:07.054000             🧑  作者: Mango
var val = "abc";
var file = new Blob([val], {
type: "text/html"
});
// file object reference
var download = URL.createObjectURL(file);
var a = document.createElement("a");
a.href = download;
a.download = "file-" + new Date().getTime();
document.body.appendChild(a);
a.click()