mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2025-12-17 14:05:12 +00:00
22 lines
456 B
JavaScript
22 lines
456 B
JavaScript
'use strict';
|
|
|
|
var shared = require('@vueuse/shared');
|
|
var QRCode = require('qrcode');
|
|
var vue = require('vue');
|
|
|
|
function useQRCode(text, options) {
|
|
const src = shared.toRef(text);
|
|
const result = vue.shallowRef("");
|
|
vue.watch(
|
|
src,
|
|
async (value) => {
|
|
if (src.value && shared.isClient)
|
|
result.value = await QRCode.toDataURL(value, options);
|
|
},
|
|
{ immediate: true }
|
|
);
|
|
return result;
|
|
}
|
|
|
|
exports.useQRCode = useQRCode;
|