RT:
代码
function getJsonFile(jObj) {
let link = document.createElement('a');
link.download = +new Date() + ".json";
link.style.display = 'none';
let blob = new Blob([JSON.stringify(jsonObj)]);
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
用途
调试时,可在console中用