17 lines
407 B
JavaScript
Raw Normal View History

2024-01-29 09:26:07 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = void 0;
const download = (url, name) => {
if (!url)
return;
const a = document.createElement('a');
a.href = url;
if (name !== undefined) {
a.download = name;
}
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
};
exports.download = download;