mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
update
This commit is contained in:
9
src/helpers/files.ts
Normal file
9
src/helpers/files.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const downloadLink = (name: string, blob: Blob) => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.href = url;
|
||||
downloadLink.download = name;
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
};
|
||||
Reference in New Issue
Block a user