mirror of
https://github.com/Art051/it-tools.git
synced 2025-08-11 19:29:03 +00:00
feat(tool): qr-code generator
This commit is contained in:
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();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user