mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
🔧:build SSR dist and deploy
This commit is contained in:
parent
76c26901d7
commit
c59ad6aedb
465 changed files with 214127 additions and 2 deletions
32
dist/server/chunks/chunk-aa632c49.js
vendored
Normal file
32
dist/server/chunks/chunk-aa632c49.js
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { get } from '@vueuse/core';
|
||||
import QRCode from 'qrcode';
|
||||
import { ref, watch, isRef } from 'vue';
|
||||
|
||||
function useQRCode({
|
||||
text,
|
||||
color: { background, foreground },
|
||||
errorCorrectionLevel,
|
||||
options
|
||||
}) {
|
||||
const qrcode = ref("");
|
||||
watch(
|
||||
[text, background, foreground, errorCorrectionLevel].filter(isRef),
|
||||
async () => {
|
||||
if (get(text)) {
|
||||
qrcode.value = await QRCode.toDataURL(get(text).trim(), {
|
||||
color: {
|
||||
dark: get(foreground),
|
||||
light: get(background),
|
||||
...options?.color
|
||||
},
|
||||
errorCorrectionLevel: get(errorCorrectionLevel) ?? "M",
|
||||
...options
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
return { qrcode };
|
||||
}
|
||||
|
||||
export { useQRCode as u };
|
Loading…
Add table
Add a link
Reference in a new issue