mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/JiboViteDocs.git
synced 2026-06-16 14:36:27 +00:00
Initalize
This commit is contained in:
21
node_modules/@vueuse/integrations/dist/useQRCode.js
generated
vendored
Normal file
21
node_modules/@vueuse/integrations/dist/useQRCode.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { isClient, toRef } from "@vueuse/shared";
|
||||
import { shallowRef, watch } from "vue";
|
||||
import QRCode from "qrcode";
|
||||
//#region useQRCode/index.ts
|
||||
/**
|
||||
* Wrapper for qrcode.
|
||||
*
|
||||
* @see https://vueuse.org/useQRCode
|
||||
* @param text
|
||||
* @param options
|
||||
*/
|
||||
function useQRCode(text, options) {
|
||||
const src = toRef(text);
|
||||
const result = shallowRef("");
|
||||
watch(src, async (value) => {
|
||||
if (src.value && isClient) result.value = await QRCode.toDataURL(value, options);
|
||||
}, { immediate: true });
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
export { useQRCode };
|
||||
Reference in New Issue
Block a user