import { ref, onMounted } from "vue"; export const randomString = (e: any) => { e = e || 32; var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz", a = t.length, n = ""; for (let i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a)); return n; }; const useUUID = () => { let uuid = ref(""); const genUUID = () => { uuid.value = randomString(9); }; onMounted(() => { genUUID(); }); return { uuid, }; }; export default useUUID;