naive-ui
Version:
A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast
16 lines (15 loc) • 376 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = download;
function 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);
}
;