mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-23 16:26:15 -04:00
feat(tool): qr-code generator
This commit is contained in:
parent
203b6a9d73
commit
5582d75927
8 changed files with 527 additions and 21 deletions
12
src/composable/downloadBase64.ts
Normal file
12
src/composable/downloadBase64.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import type { Ref } from 'vue';
|
||||
|
||||
export function useDownloadFileFromBase64({ source, filename = 'file' }: { source: Ref<string>; filename?: string }) {
|
||||
return {
|
||||
download() {
|
||||
const a = document.createElement('a');
|
||||
a.href = source.value;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue